quick3.3编译sqlite3的时候,编译so成功,但是 打包apk后闪退。
04-07 14:24:41.114 4844-4844/? E/dalvikvm﹕ dlopen("/data/app-lib/libcocos2dlua.so") failed: dlopen failed: cannot locate symbol "signal" referenced by "libcocos2dlua.so"...
04-07 14:24:41.119 4844-4844/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.dd.mj, PID: 4844
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "signal" referenced by "libcocos2dlua.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:531)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264)
at com.dd.mj.AppActivity.onCreate(AppActivity.java:78)
at android.app.Activity.performCreate(Activity.java:5351)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2323)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2411)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5315)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:660)
at dalvik.system.NativeStart.main(Native Method)
解决方案:
When you use the ndk r10, android-21 is used by default but it's not fully retro-compatible with devices running former Android versions. In your case, signal can't be found on your device (but it would run properly on Lollipop).
When using the NDK, you should use the platform (APP_PLATFORM:=android-XX) that corresponds to your android:minSdkVersion.
So here you can set APP_PLATFORM:=android-15 inside Application.mk Makefile, and your lib will use the inline version of signal, so it will not look for its symbol at runtime.