高德 java.lang.UnsatisfiedLinkError: Native method not found: com.autonavi.amap.mapc

 我的項目是從eclipse上轉到Android studio上的

 結果發現在使用高德的時候報錯了,

 下面是錯誤信息:

                java.lang.UnsatisfiedLinkError: Native method not found:                                                                            com.autonavi.amap.mapcore.MapCore.nativeNewInstance:(Ljava/lang/String;)J at                                   com.autonavi.amap.mapcore.MapCore.nativeNewInstance(Native Method) at                                         com.autonavi.amap.mapcore.MapCore.(MapCore.java:62) at                                                                     com.amap.api.mapcore.AMapDelegateImpGLSurfaceView.  

                (AMapDelegateImpGLSurfaceView.jav    a:345) at                                                                                     com.amap.api.mapcore.AMapDelegateImpGLSurfaceView.   

             (AMapDelegateImpGLSurfaceView.java:307) at                                     com.amap.api.mapcore.ai.a(MapFragmentDelegateImp.java:122) at              com.amap.api.maps.MapView.onCreate(MapView.java:131)

  網上查了好久,我覺得解決方式大概是2種:

      第一種:由於 轉Android studio的時候沒有注意。所以so文件無法識別,需要在build.gradle裏設置 main {

            jniLibs.srcDirs = ['libs']

        }

        第二種:由於你的libs裏面有很多的jni的類庫,但是高德沒有這麼多類庫,但是當你添加了之後就會系統就會到這個類庫裏面找,就出錯了。所以,如果可以的話,刪除不需要的類庫。(或者往裏面添加高德的so文件(沒試過,不知道有沒有效果))

       





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章