【发布时间】:2016-09-30 13:15:22
【问题描述】:
A/art(30231): art/runtime/check_jni.cc:65] string: 'LevelScore11�
art/runtime/check_jni.cc:65] '
art/runtime/check_jni.cc:65] in call to NewStringUTF
A/art(16684): art/runtime/check_jni.cc:65] from void org.cocos2dx.lib.Cocos2dxRenderer.nativeRender()
A/art(16684): art/runtime/check_jni.cc:65] native: #08 pc 003e93f8 /data/app/com.xxxxxxxxxx/lib/arm/libcocos2dcpp.so (_ZN7_JNIEnv12NewStringUTFEPKc+40)
art/runtime/check_jni.`enter code here`cc:65] native: #09 pc 003efc8c /data/app/xxxxxxxxxxxxx/lib/arm/libcocos2dcpp.so (_Z19setIntegerForKeyJNIPKci+112)
art/runtime/check_jni.cc:65] native: #10 pc 005cd8b8 /data/app/xxxxxxxxxxx/lib/arm/libcocos2dcpp.so (_ZN7cocos2d11UserDefault16setIntegerForKeyEPKci+40)
art/runtime/check_jni.cc:65] native: #11 pc 003d62a8 /data/app/xxxxxxxxxxxx/lib/arm/libcocos2dcpp.so (???)
art/runtime/check_jni.cc:65] native: #12 pc 004553f4 /data/app/xxxxxxxxxxxx/lib/arm/libcocos2dcpp.so (_ZN7cocos2d8CallFunc7executeEv+156)
art/runtime/check_jni.cc:65] native: #13 pc 0045534c /data/app/xxxxxxxxxxxx/lib/arm/libcocos2dcpp.so (_ZN7cocos2d8CallFunc6updateEf+40)
对于许多文件,我在调用时遇到错误
NewStringUTF 函数
APP 在这个函数处崩溃。
有更新的版本吗?我找到了很多解决方案,但没有运气。谁能帮帮我?
提前谢谢你。
【问题讨论】:
-
发布您创建的整个 JNI 调用及其导致此崩溃的原因,以便我们查看您做了什么。
-
@IulianVărzaru 我无法找到导致错误的文件
-
第 13 个字符不是 utf8 字符,因此会导致 NewStringUTF 函数崩溃。尝试在创建字符串之前转储 char*。
-
@SimonMarquis 我该如何转储它?有什么选择吗?
标签: android java-native-interface cocos2d-x cocos2d-android