I’m having an isssue running on android 4.2. Any thoughts? I’m building against android-19/android-ndk-r10e/ cocos 3.7 (upgrading is currently not practical).
Yes, it’s crashing when FileUtilsAndroid creates it’s underlying instance, so it is getting to the invocation of my code.
An older build worked on Android 5. Not a helpful response, I know. I had other issues w/ simulators so I’m limited on my testing devices.
Builds and works fine on iOS
No.
My gut is telling me something is screwed up somewhere that’s causing the JavaVM instance in JniHelper to be null. since cacheEnv(jvm) calls jvm->getEnv() without checking jvm
This leads me to the following in my logcat
No JNI_OnLoad found in /data/app-lib/com.game.tos-1/libc++_shared.so 0x416ee538, skipping init
I think i’m on the right track here but am missing something.
I have found the cause of this issue. Wanted to follow up here incase anyone else runs into it.
This comes from accessing the FileUtils() class during the initialization of a static variable. Static variables as we all know are initialized VERY early. In this case initialized before JNI_OnLoad has a chance to set the JVM reference, which FileUtilsAndroid depends on.