0

Arcgis MapView provides error on some devices(I believe 64-bit) while inflating MapView.

Error starts with

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

and in the last line:

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"

It looks like it can't find library in some cases.

Arcgis version:

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

Simple layout:

<?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>

Complete log:

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"
Sharjeel
  • 15,588
  • 14
  • 58
  • 89

1 Answers1

1

Do you have dependencies in your project which are 64-bit only? Android cannot load mixed native libs, it only works by loading either 32 or 64 bit. And the 10.2.8 runtime only has 32-bit available. So if it's already loaded a 64-bit lib in your app, it wont be able to load the Esri runtime; however 64 bit devices can load 32 bit libs fine, as they're forwardly compatible.

One way to solve this is to remove 64-bit libs so they don't get included in the APK and cant be loaded in the app. If the 64-bit dependencies in your app are included directly in your build as .so files, then just remove the 64-bit folder (e.g. \jniLibs\arm64-v8a) from your build. If you're using gradle in Android Studio, and the dependencies are in AARs, I think you can try the ABI splits described in the Android doc to exclude 64 bit libs - for example, to specifically exclude Armv8 64 bit libs, update your gradle script to include:

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

There's a few different option for splits - see the doc link above.

SGill
  • 896
  • 10
  • 16