when I tried to package an old cocos2dx NDK project, I encountered this problem, apk could be exported but crashed when start running it.

Here is the log I get from eclipse logcat:

FATAL EXCEPTION: mainjava.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1521]:   492 unknown reloc type   160 @      (60218)at java.lang.Runtime.loadLibrary(Runtime.java:434)at java.lang.System.loadLibrary(System.java:554)at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:246)at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:260)at org.cocos2dx.phonegame.PhoneGameActivity.onCreate(PhoneGameActivity.java:83)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)at android.app.ActivityThread.access$1500(ActivityThread.java:117)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)at android.os.Handler.dispatchMessage(Handler.java:99)at android.os.Looper.loop(Looper.java:130)at android.app.ActivityThread.main(ActivityThread.java:3683)at java.lang.reflect.Method.invokeNative(Native Method)at java.lang.reflect.Method.invoke(Method.java:507)at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:638)at dalvik.system.NativeStart.main(Native Method)

First, I clean the project and rebuild it. but the problem is still there.

Then, I find another project and rewrite the Android.mk file under jni folder, but still not ok.

I don't think it's the problem with ndk version, because other project with the same ndk could run perfectly.

At last, I rewrite the Application.mk file under jni folder, this time the ndk compiler rebuild the libc++_static.a and everything is ok.

In a word, this problem in my case is caused by old wrong libc++static.a lib, and only clean the project and rebuild cannot update it.


Solution: Change the Application.mk and force the libc++static.a to be rebuild.
(ps:Maybe delete the obj folder could also make it.)

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. 生成android的bks证书
  2. android中关于Sqlite的问题
  3. Android(安卓)(shape,gradient)使用总结
  4. Android(安卓)异步获取网络图片并处理图
  5. Android通过shape.xml制作渐变背景
  6. Android高德地图获取当前地理位置(不显示
  7. Unity3D在android下调试
  8. 常用的android开发网站
  9. android触控,先了解MotionEvent
  10. Android广播接实现电话的监听(电话的状态,