Select to view content in your preferred language

Error inflating class com.esri.android.map.MapView for Android 64-bit Lollipop device

6800
4
Jump to solution
11-19-2015 01:10 AM
JudyTo
by
Deactivated User

Hi all,

I encountered the exception below when running the esri map on my LG G4 (64 bit Lollipop).

I was using SDK 10.2.5 and have already upgrade to 10.2.7, removed the old .so and jar files from 10.2.5 (as I was using Eclipse previously) and followed the instructions to install with Gradle in Android Studio.

   repositories { jcenter() maven { url 'https://esri.bintray.com/arcgis' } } dependencies { compile 'com.esri.arcgis.android:arcgis-android:10.2.7' }

I noticed in the error below it's because it  "couldn't find "libruntimecore_java.so"" Does that mean that I still need to manually include the .so files into the lib folder even after I install using Gradle?

________________________________________________________________________________________

E/AndroidRuntime: android.view.InflateException: Binary XML file line #6: Error inflating class com.esri.android.map.MapView

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:633)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.hdb.mobilehdbv2.mapservices.OneMapTabActivity.onCreateView(OneMapTabActivity.java:169)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:288)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:607)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.hdb.mobilehdbv2.mapservices.OneMapTabActivity.onCreateView(OneMapTabActivity.java:169)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:913)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/hdb.android-2/base.apk"],nativeLibraryDirectories=[/data/app/hdb.android-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libruntimecore_java.so"

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:366)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.System.loadLibrary(System.java:988)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.esri.core.internal.RuntimeHelper.a(SourceFile:85)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.esri.core.internal.RuntimeHelper.initialize(SourceFile:47)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.esri.android.map.MapSurface.<clinit>(SourceFile:68)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.esri.android.map.MapView.a(SourceFile:586)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at com.esri.android.map.MapView.<init>(SourceFile:621)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Native Method)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Constructor.newInstance(Constructor.java:288)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createView(LayoutInflater.java:607)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:504)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.view.LayoutInflater.inflate(LayoutInflater.java:414)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.hdb.mobilehdbv2.mapservices.OneMapTabActivity.onCreateView(OneMapTabActivity.java:169)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.Fragment.performCreateView(Fragment.java:1965)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1078)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1259)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1624)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5430)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)

11-19 16:46:53.924 30290-30290/? E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)

0 Kudos
1 Solution

Accepted Solutions
JudyTo
by
Deactivated User

Hi Shelly,

Thanks for your reply.

I managed to figure out the issue.

The app is using a number of libraries and one of the libraries, in aar format, creates the arm64-v8a folder.

However as esri library does not provide the 64-bit library in the folder, hence it keeps returning the exception.

So I followed the instructions in this article to set abiFilters to package only 32-bit libraries and it works!

http://stackoverflow.com/questions/30782848/how-to-use-32-bit-native-libaries-on-64-bit-android-devi...

View solution in original post

4 Replies
JudyTo
by
Deactivated User

Hi all,

I tried all possible combination:

1. gradle install with 10.2.5, 10.2.6-2 and 10.2.7. When I run the program, under exploded-aar, I see that the SDK is loaded properly (all the .jar and .so files are created).

2. manual install with 10.2.5 and 10.2.7. I copied over all the .jar and .so files to the /lib folder and update my gradle.build to compile the .jar

Both gave me the same error.

When I was on Eclipse, I was using the manual install with 10.2.5 and had no issues with Android Lollipop on 64 bit devices

0 Kudos
ShellyGill1
Esri Contributor

Hi,

I'd expect running an app built with 10.2.7 on a 64bit Armv8 device (like your LG), from Android Studio, built with gradle using the AAR, would work OK. The 10.2.7 release does not include Armv8-specific libraries, but Arm v8 is backwardly compatible with Arm v7 (and Armv7 library is included in the AAR). We have tested that internally, so we need to figure out what's different in your situation.

In the stack trace, the loadLibrary failure mentions paths `nativeLibraryDirectories=[/data/app/hdb.android-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libruntimecore_java.so` - which I'm not sure would be expected. A colleague pointed out to me this article with information about some problems loading native libraries when using different package managers. Can you confirm how you're loading the APK onto the device? (I would guess debugging via Android Studio but could be something else). Also maybe worth confirming which version of Android Studio you're running, and your development platform.

> manual install with 10.2.5 and 10.2.7. I copied over all the .jar and .so files to the /lib folder and

> update my gradle.build to compile the .jar

If you're including .so directly (not using the AAR), then watch out for the paths you're using. In Android Studio the expected paths for native libraries are different to Eclipse. You can follow the same instructions for paths as described here for 'Add native libraries for analysis features' - for example '/src/main/jniLibs/armeabi-v7a/libruntimecore_java.so'. You could try changing your paths and see how you get on with manually including the libraries then.

Regards,

Shelly

0 Kudos
JudyTo
by
Deactivated User

Hi Shelly,

Thanks for your reply.

I managed to figure out the issue.

The app is using a number of libraries and one of the libraries, in aar format, creates the arm64-v8a folder.

However as esri library does not provide the 64-bit library in the folder, hence it keeps returning the exception.

So I followed the instructions in this article to set abiFilters to package only 32-bit libraries and it works!

http://stackoverflow.com/questions/30782848/how-to-use-32-bit-native-libaries-on-64-bit-android-devi...

ShellyGill1
Esri Contributor

Hi - thanks for posting your solution back here. Good point -  I read that once a native library has been loaded, the same path will be used for other libraries as well...

We are currently looking at providing specific x64 support in our upcoming Quartz release (no change in the Beta 1 currently though).

0 Kudos