so库冲突问题解决

在开发高德地图的时候出现如下错误

03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/dalvikvm: No implementation found for native Lcom/autonavi/amap/mapcore/MapCore;.nativeNewInstance:(Ljava/lang/String;Ljava/lang/String;)J
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err: java.lang.UnsatisfiedLinkError: Native method not found: com.autonavi.amap.mapcore.MapCore.nativeNewInstance:(Ljava/lang/String;Ljava/lang/String;)J
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.autonavi.amap.mapcore.MapCore.nativeNewInstance(Native Method)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.autonavi.amap.mapcore.MapCore.newMap(MapCore.java:101)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.amap.api.mapcore.b.C(AMapDelegateImp.java:443)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.amap.api.mapcore.b.a(AMapDelegateImp.java:133)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.amap.api.mapcore.b$1.run(AMapDelegateImp.java:340)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1472)
03-10 17:04:45.830 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1249)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/dalvikvm: No implementation found for native Lcom/autonavi/amap/mapcore/MapCore;.nativeNewInstance:(Ljava/lang/String;Ljava/lang/String;)J
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err: java.lang.UnsatisfiedLinkError: Native method not found: com.autonavi.amap.mapcore.MapCore.nativeNewInstance:(Ljava/lang/String;Ljava/lang/String;)J
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.autonavi.amap.mapcore.MapCore.nativeNewInstance(Native Method)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.autonavi.amap.mapcore.MapCore.newMap(MapCore.java:101)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.amap.api.mapcore.b.C(AMapDelegateImp.java:443)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at com.amap.api.mapcore.b.onSurfaceCreated(AMapDelegateImp.java:3219)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1510)
03-10 17:04:45.890 20047-20183/com.mandao.balance.bike.myapplication W/System.err:     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1249)
03-10 17:04:45.970 877-20201/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1510 com.android.server.InputMethodManagerService$4.run:2835 java.lang.Thread.run:841   
03-10 17:04:46.340 877-984/? W/ActivityManager: mDVFSHelper.release()
根据错误提示,找不到so库里面的方法。由于之前的地图一直在使用,so库放在armeabi下面,地图加载没有任何问题.

问题排除

经过一系列的问题排除,最终确定是由于armeabi-v7a库的问题,由于其他moudule下面存在armeabi-v7a库,所以高德sdk去其他moudule下面去找相应的方法就会报

java.lang.UnsatisfiedLinkError: Native method not found: com.autonavi.amap.mapcore.MapCore.nativeNewInstance:(Ljava/lang/String;Ljava/lang/String;)J
经过了解资料

所以armeabi-v7a 应该是与AIR限定支持android2.2以上的条件有关。android2.2以上能让硬件发挥更大的作用。

对于AIR项目来说性能问题是最大的瓶颈,能优化一点就一点,所以如果接平台方SDK或者写ANE的时候使用到SO库,个人推荐全部放到armeabi-v7a下,而不要为了兼容放到armeabi。
armeabi-v7a库对系统进行了优化,所以会去armeabi-v7a文件下面调用

解决方案

把armeabi文件下面的库文件copy到armeabi-v7a,完美解决找不到so库的问题

你可能感兴趣的:(android小知识点,android,高德地图加载不出来,so库文件冲突,armeabi-v7a)