Skip to content

Commit afa9a4a

Browse files
committed
fix android build
1 parent 6641f1e commit afa9a4a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

native/src/CubismUserModel_JNI.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,13 @@ class JniUserModel : public CubismUserModel {
147147
private:
148148
JNIEnv* getEnv() {
149149
JNIEnv* env;
150-
if (_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) == JNI_EDETACHED) _jvm->AttachCurrentThread((void**)&env, nullptr);
150+
if (_jvm->GetEnv((void**)&env, JNI_VERSION_1_6) == JNI_EDETACHED) {
151+
#ifdef __ANDROID__
152+
_jvm->AttachCurrentThread(&env, nullptr);
153+
#else
154+
_jvm->AttachCurrentThread((void**)&env, nullptr);
155+
#endif
156+
}
151157
return env;
152158
}
153159

scripts/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def download_sdk():
4343

4444
gles2_hpp = os.path.join(SDK_DIR, "Framework/src/Rendering/OpenGL/CubismRenderer_OpenGLES2.hpp")
4545
with open(gles2_hpp, "r", encoding="utf-8") as f: content = f.read()
46+
content = content.replace("void Initialize(Framework::CubismModel* model);",
47+
"void Initialize(Framework::CubismModel* model) override;")
4648
content = content.replace("void Initialize(Framework::CubismModel* model, csmInt32 maskBufferCount);",
4749
"void Initialize(Framework::CubismModel* model, csmInt32 maskBufferCount) override;")
4850
content = content.replace("virtual void SaveProfile();", "void SaveProfile() override;")

0 commit comments

Comments
 (0)