'checkjni error happen when use android studio build apk, while use unity build apk run well

with my jni demo, i use CallStaticIntMethod to call java method with boolean return. then i build this to .so, when i use this so in android studio project, the app will crash with error message like: JNI DETECTED ERROR IN APPLICATION: the return type of CallStaticIntMethodV does not match boolean a.sheng.navivelibrary.NativeUtils.callBoolean(). what confuse me is that this work well when i use the so in unity project and build android apk with unity. i have checked the gradle\ndk settings in unity or android studio, but cannot find the reason why this differences happen. anybody know the reason?



Solution 1:[1]

I have solved this problem: 1, choose Development Build will open checkjni in unity, then will get this error 2, build debug will open checkjni while build release will close checkjni with android studio

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sheng