0

Arcgis MapView 在膨胀 MapView 时在某些设备(我相信是 64 位)上提供错误。

错误开始于

Binary XML file line #13: Binary XML file line #13: Error inflating class com.esri.android.map.MapView

在最后一行:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.labs.arctest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.labs.arctest-1/lib/arm64, /data/app/com.labs.arctest-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libruntimecore_java.so"

在某些情况下,它似乎找不到库。

弧形版本:

compile 'com.esri.arcgis.android:arcgis-android:10.2.7'

简单的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.labs.arctest.MainActivity">

    <com.esri.android.map.MapView
        android:id="@+id/map"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        mapoptions.MapType="Streets"
        >
    </com.esri.android.map.MapView>
</RelativeLayout>

完整的日志:

07-15 03:35:52.338 27987 27987 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.labs.arctest/com.labs.arctest.MainActivity}: android.view.InflateException: Binary XML file line #13: Binary XML file line #13: Error inflating class com.esri.android.map.MapView
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2452)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread.access$900(ActivityThread.java:154)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:152)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5497)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
07-15 03:35:52.338 27987 27987 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #13: Binary XML file line #13: Error inflating class com.esri.android.map.MapView
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at com.labs.arctest.MainActivity.onCreate(MainActivity.java:27)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6285)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    ... 9 more
07-15 03:35:52.338 27987 27987 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class com.esri.android.map.MapView
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.createView(LayoutInflater.java:645)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    ... 17 more
07-15 03:35:52.338 27987 27987 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at java.lang.reflect.Constructor.newInstance(Native Method)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    at android.view.LayoutInflater.createView(LayoutInflater.java:619)
07-15 03:35:52.338 27987 27987 E AndroidRuntime:    ... 22 more
07-15 03:35:52.338 27987 27987 E AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.labs.arctest-1/base.apk"],nativeLibraryDirectories=[/data/app/com.labs.arctest-1/lib/arm64, /data/app/com.labs.arctest-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libruntimecore_java.so"
4

1 回答 1

1

您的项目中是否有仅 64 位的依赖项?Android 无法加载混合的原生库,它只能通过加载 32 位或 64 位来工作。而 10.2.8 运行时只有 32 位可用。因此,如果它已经在您的应用程序中加载了 64 位库,它将无法加载 Esri 运行时;但是 64 位设备可以很好地加载 32 位库,因为它们是向前兼容的。

解决此问题的一种方法是删除 64 位库,这样它们就不会包含在 APK 中并且无法加载到应用程序中。如果您的应用程序中的 64 位依赖项作为.so文件直接包含在您的构建中,那么只需从您的构建中删除 64 位文件夹(例如\jniLibs\arm64-v8a)。如果您在 Android Studio 中使用 gradle,并且依赖项在 AAR 中,我认为您可以尝试Android 文档中描述的 ABI 拆分以排除 64 位库 - 例如,要专门排除 Armv8 64 位库,请更新您的 gradle脚本包括:

android {
  ...
  splits {
    abi {
      exclude 'arm64-v8a'
    }
  }
}

拆分有几个不同的选项 - 请参阅上面的文档链接。

于 2016-08-21T17:46:07.183 回答