在win32下面跑没问题,到Android上面就崩溃了。代码看了好几次,感觉没发现野指针。用addr2line检查地址00352a0c,只输入JNI_OnLoad函数,和两个问号。
319-319/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
319-319/? I/DEBUG: Build fingerprint: ‘samsung/h3gzc/hlte:5.0/LRX21V/N9006ZCUGOH2:user/release-keys’
319-319/? I/DEBUG: Revision: ‘8’
319-319/? I/DEBUG: ABI: ‘arm’
319-319/? I/DEBUG: pid: 2561, tid: 2561, name: Zzzen.YourWorld >>> com.github.Zzzen.YourWorld <<<
319-319/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
319-319/? I/DEBUG: r0 b4f512b0 r1 1fffffff r2 2e7e0d8d r3 b4f512b0
319-319/? I/DEBUG: r4 00000043 r5 b4f18228 r6 a20f99e4 r7 00000000
319-319/? I/DEBUG: r8 b4f07800 r9 b4efac64 sl bef10b58 fp bef10984
319-319/? I/DEBUG: ip a275abd0 sp bef10978 lr a20f9a10 pc 00000000 cpsr 600f0010
319-319/? I/DEBUG: #00 pc 00000000
319-319/? I/DEBUG: #01 pc 00352a0c /data/app/com.github.Zzzen.YourWorld-1/lib/arm/libcocos2dcpp.so (JNI_OnLoad+40)
319-319/? I/DEBUG: #02 pc 001d5357 /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, art::Handleart::mirror::ClassLoader, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >)+1478)
319-319/? I/DEBUG: #03 pc 001fd061 /system/lib/libart.so (art::Runtime_nativeLoad(_JNIEnv, _jclass*, _jstring*, _jobject*, _jstring*)+548)
319-319/? I/DEBUG: #04 pc 00019811 /system/framework/arm/boot.oat