解决引入MapView报错的问题

只愿长相守 提交于 2020-01-08 10:02:35

一.异常内容

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.xxx.xxx, PID: 18070
                  java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxx/com.xxx.xxx.activity.MapActivity}: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.esri.arcgisruntime.mapping.view.MapView
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2566)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)
                      at android.app.ActivityThread.access$1100(ActivityThread.java:170)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:179)
                      at android.app.ActivityThread.main(ActivityThread.java:5769)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
                   Caused by: android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class com.esri.arcgisruntime.mapping.view.MapView
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
                      at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:397)
                      at android.app.Activity.setContentView(Activity.java:2231)
                      at com.xxx.xxx.activity.MapActivity.onCreate(MapActivity.java:162)
                      at android.app.Activity.performCreate(Activity.java:6497)
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519)
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
                      at android.app.ActivityThread.access$1100(ActivityThread.java:170) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:179) 
                      at android.app.ActivityThread.main(ActivityThread.java:5769) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674) 
                   Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.esri.arcgisruntime.mapping.view.MapView
                      at android.view.LayoutInflater.createView(LayoutInflater.java:645)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
                      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                      at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:397) 
                      at android.app.Activity.setContentView(Activity.java:2231) 
                      at com.xxx.xxx.activity.MapActivity.onCreate(MapActivity.java:162) 
                      at android.app.Activity.performCreate(Activity.java:6497) 
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) 
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519) 
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
                      at android.app.ActivityThread.access$1100(ActivityThread.java:170) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:179) 
                      at android.app.ActivityThread.main(ActivityThread.java:5769) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674) 
                   Caused by: java.lang.reflect.InvocationTargetException
                      at java.lang.reflect.Constructor.newInstance(Native Method)
                      at android.view.LayoutInflater.createView(LayoutInflater.java:619)
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
                      at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
                      at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
                      at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
                      at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
                      at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:397) 
                      at android.app.Activity.setContentView(Activity.java:2231) 
                      at com.xxx.xxx.activity.MapActivity.onCreate(MapActivity.java:162) 
                      at android.app.Activity.performCreate(Activity.java:6497) 
                      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) 
                      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2519) 
                      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
                      at android.app.ActivityThread.access$1100(ActivityThread.java:170) 
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1494) 
                      at android.os.Handler.dispatchMessage(Handler.java:102) 
                      at android.os.Looper.loop(Looper.java:179) 
                      at android.app.ActivityThread.main(ActivityThread.java:5769) 
                      at java.lang.reflect.Method.invoke(Native Method) 
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674) 
                   Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.xxx.xxx-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm64, /data/app/com.xxx.xxx-1/base.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.xxx.xxx-1/s

二.解决方案:

defaultConfig {
      
        ndk{
            abiFilters "armeabi-v7a","x86","armeabi","mips"
        }
    }
 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!