Couldn't load GLMapCore: findLibrary returned null

1591
10
Jump to solution
01-24-2012 11:40 AM
ScottPio
New Contributor
Im getting this Error when loading an ESRI map inside the Android Environment.  This didn't happen with ESRI's .1 Alpha SDK, but it does happen with their 1.0.0 SDK.

I know it has something to do with the OpenGL lib, but can't seem to find a solution.  I am running the Motorola Xoom Tablet with the latest Android environment.

Also Its using Fragments, so that might have something to do with it.

Here is my stack Dump


    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): FATAL EXCEPTION: main
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.irad.GeoHome/com.irad.GeoHome.map.EsriMapWidget}: android.view.InflateException: Binary XML file line #13: Error inflating class com.esri.android.map.MapView
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread.access$500(ActivityThread.java:122)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1027)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.os.Handler.dispatchMessage(Handler.java:99)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.os.Looper.loop(Looper.java:132)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread.main(ActivityThread.java:4126)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.reflect.Method.invokeNative(Native Method)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.reflect.Method.invoke(Method.java:491)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at dalvik.system.NativeStart.main(Native Method)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class com.esri.android.map.MapView
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.createView(LayoutInflater.java:596)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:671)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.irad.GeoHome.map.EsriMapFragment.onCreateView(EsriMapFragment.java:21)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:714)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:912)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:990)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:257)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:660)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:724)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.inflate(LayoutInflater.java:347)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:245)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.Activity.setContentView(Activity.java:1786)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.irad.GeoHome.map.EsriMapWidget.onCreate(EsriMapWidget.java:155)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1782)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     ... 11 more
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): Caused by: java.lang.reflect.InvocationTargetException
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.reflect.Constructor.constructNative(Native Method)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.reflect.Constructor.newInstance(Constructor.java:416)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at android.view.LayoutInflater.createView(LayoutInflater.java:576)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     ... 31 more
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): Caused by: java.lang.ExceptionInInitializerError
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.esri.android.map.MapView.a(Unknown Source)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.esri.android.map.MapView.<init>(Unknown Source)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     ... 34 more
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): Caused by: java.lang.ExceptionInInitializerError
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.esri.android.map.MapSurface.<clinit>(Unknown Source)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     ... 36 more
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load GLMapCore: findLibrary returned null
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.Runtime.loadLibrary(Runtime.java:425)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at java.lang.System.loadLibrary(System.java:554)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     at com.esri.android.map.Layer.<clinit>(Unknown Source)
    01-24 14:20:31.290: ERROR/AndroidRuntime(4370):     ... 37 more
0 Kudos
1 Solution

Accepted Solutions
KyleShimabukuro
New Contributor III
I ran into a similar problem while refactoring my app that was based on the beta api. The fix for me was to open a sample ArcGIS app (in Eclipse, File > New > Other > ArcGIS for Android > ArcGIS Samples for Android) and copy the lib folder to my project.

Sorry for not being more specific, I don't have my development machine in front of me at the moment. Hope this helps!

View solution in original post

0 Kudos
10 Replies
DanO_Neill
Occasional Contributor III
A lot has changed between beta SDK and release with respect to the MapView so you may need to refactor your code a bit.  Can you share the code on how you are instantiating the MapView component?
0 Kudos
ScottPio
New Contributor
We have tried this particular bug on many different devices.

Motorola Xoom
HTC Thunderbolt
Samsung Nexus S
Samsung Tablet

All failed to load with the same error.

We refactored our code to be updated with the current Release. We were using the Alpha Release at first.

We also tried the sample project that has been posted on the ESRI site. We figured it might be us, so we should try a very simple example first.


My Activity:

public class GeotestActivity extends Activity {
MapView map = null;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

// Retrieve the map and initial extent from XML layout
map = (MapView)findViewById(R.id.map);
// Add dynamic layer to MapView
map.addLayer(new ArcGISDynamicMapServiceLayer("" +
"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"));
//Retrieve the non-configuration instance data that was previously returned.
Object init = getLastNonConfigurationInstance();
if (init != null) {
map.restoreState((String) init);
}


}
protected void onPause() {
super.onPause();
map.pause();
}

protected void onResume() {
super.onResume();
map.unpause();
}
}


My Layout


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
androidrientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>


<!-- MapView layout and initial extent -->
<com.esri.android.map.MapView
android:id="@+id/map"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005">
</com.esri.android.map.MapView>
</LinearLayout>


My Manifest



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.geotest.irad"
android:versionCode="1"
android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<uses-sdk android:minSdkVersion="8" />
<uses-feature android:glEsVersion="0x00020000"/>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".GeotestActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
</manifest>
0 Kudos
KyleShimabukuro
New Contributor III
I ran into a similar problem while refactoring my app that was based on the beta api. The fix for me was to open a sample ArcGIS app (in Eclipse, File > New > Other > ArcGIS for Android > ArcGIS Samples for Android) and copy the lib folder to my project.

Sorry for not being more specific, I don't have my development machine in front of me at the moment. Hope this helps!
0 Kudos
ScottPio
New Contributor
That was it, Thank you kshimabukuro!
0 Kudos
_lkerArg_n
New Contributor
I ran into a similar problem while refactoring my app that was based on the beta api. The fix for me was to open a sample ArcGIS app (in Eclipse, File > New > Other > ArcGIS for Android > ArcGIS Samples for Android) and copy the lib folder to my project.

Sorry for not being more specific, I don't have my development machine in front of me at the moment. Hope this helps!


I had the same problem, too but didn't have to copy the libraries by hand. If you are developing in Eclipse right click on the Project and then AtcGIS Tools -> Convert to ArcGIS Android Porject. This automatically copies the required libraries.

ArcGIS_Android.jar
jackson-core-lgpl-1.6.3.jar
jackson-mapper-lgpl-1.6.3 and

armeabi / libGLMapCore.so
armeabi-v7a / libGLMapCore.so
0 Kudos
philziklee
New Contributor
I had the same problem, too but didn't have to copy the libraries by hand. If you are developing in Eclipse right click on the Project and then AtcGIS Tools -> Convert to ArcGIS Android Porject. This automatically copies the required libraries.

ArcGIS_Android.jar
jackson-core-lgpl-1.6.3.jar
jackson-mapper-lgpl-1.6.3 and

armeabi / libGLMapCore.so
armeabi-v7a / libGLMapCore.so


this is right way~~
0 Kudos
Venkata_RaoTammineni
Occasional Contributor
I had the same problem, too but didn't have to copy the libraries by hand. If you are developing in Eclipse right click on the Project and then AtcGIS Tools -> Convert to ArcGIS Android Porject. This automatically copies the required libraries.

ArcGIS_Android.jar
jackson-core-lgpl-1.6.3.jar
jackson-mapper-lgpl-1.6.3 and

armeabi / libGLMapCore.so
armeabi-v7a / libGLMapCore.so


Dear Mggl,

I am not getting Convert to ArcGIS Android Project . Which is disable in my project. is something i am missing. Can you please guide me.

work environment is
1)  Eclips Version: Helios Service Release 2
2) ArcGIS sdk 2.0
3) Emulator 2.2

Thanks and Regards,

Venkat
0 Kudos
Arjanvan_Zutphen2
New Contributor
I am having the same problem. I can´t get my app working on the emulator, but it does work on my device. I already try to replace the libs from a ArcGIS sample to my own project, but it didn't help. Was not that surprising as the ArcGIS sample didn't work on the emulator either.

Environment:
- Eclips Version: Juno
- ArcGIS sdk 2.0
- Emulator 2.2

It would be great if it works on the emulator as well.
0 Kudos
MartinRick
Occasional Contributor II
Had the same issue and solved the problem by adding the ArcGIS Runtime libs in the Java Build Path.

right-clicked on the project name in the PackageExplorer -> click build path -> Order and Export -> check ArcGIS library
0 Kudos