Unsatisfied link error find library returned null - Hello World sample app

4270
4
Jump to solution
06-26-2013 03:54 AM
VansiKrishna
New Contributor II
Hello Readers,

This is my first time into the ArcGIS but not the first time for Android. I am an Android developer. For one of our recent projects, i am exploring the ArcGIS modules/samples. I did the following steps:

1. Installed Eclipse JUNO (latest) - Since my previous version got corrupted, had to replace the system.
2. Downloaded ArcGIS runtime SDK for Android 10.1.1.
3. Installed the ArcGIS plugin from the downloaded zip file obtained from step 2.
4. Restarted Eclipse/System.

Now to explore the basic "Hello World" ArcGIS app, i did the following steps.

1. File - New - Project - In the new window - selected the "ArcGIS for Android" option.
2. Out of the 2 options i selected "ArcGIS samples for Android". This option opened another window to fetch the samples from local or online.
3. I selected "LOCAL".
4. Under "Maps" section, i selected the "Hello World" sample project.
5. Now the Hello World project is in my workspace.
6. Cleaned and build the project. All errors gone.
7. Run the project.

I am obtaining the following error log:

06-26 16:36:15.678: E/AndroidRuntime(2672): FATAL EXCEPTION: main
06-26 16:36:15.678: E/AndroidRuntime(2672): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.esri.arcgis.android.samples.helloworld/com.esri.arcgis.android.samples.helloworld.HelloWorld}: android.view.InflateException: Binary XML file line #9: Error inflating class com.esri.android.map.MapView
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.os.Looper.loop(Looper.java:137)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread.main(ActivityThread.java:4745)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.reflect.Method.invokeNative(Native Method)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.reflect.Method.invoke(Method.java:511)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at dalvik.system.NativeStart.main(Native Method)
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.esri.android.map.MapView
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.createView(LayoutInflater.java:613)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.Activity.setContentView(Activity.java:1867)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.arcgis.android.samples.helloworld.HelloWorld.onCreate(HelloWorld.java:42)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.Activity.performCreate(Activity.java:5008)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
06-26 16:36:15.678: E/AndroidRuntime(2672):  ... 11 more
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.reflect.InvocationTargetException
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.reflect.Constructor.constructNative(Native Method)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at android.view.LayoutInflater.createView(LayoutInflater.java:587)
06-26 16:36:15.678: E/AndroidRuntime(2672):  ... 22 more
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.ExceptionInInitializerError
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.android.map.MapView.a(Unknown Source)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.android.map.MapView.<init>(Unknown Source)
06-26 16:36:15.678: E/AndroidRuntime(2672):  ... 25 more
06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load runtimecore_java: findLibrary returned null
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.Runtime.loadLibrary(Runtime.java:365)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at java.lang.System.loadLibrary(System.java:535)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.core.internal.util.e$1.initialize(Unknown Source)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.android.io.a.a(Unknown Source)
06-26 16:36:15.678: E/AndroidRuntime(2672):  at com.esri.android.map.MapSurface.<clinit>(Unknown Source)
06-26 16:36:15.678: E/AndroidRuntime(2672):  ... 27 more

Later i followed the ArcGIS forums and came across many links for example
http://forums.arcgis.com/threads/48462-Couldn-t-load-GLMapCore-findLibrary-returned-null
http://forums.arcgis.com/threads/85021-Can%C2%B4t-make-Hello-World-run
but alas the error was never cleared.

I encountered a similar problem with one of my Android projects. It had the libs folder with .so files for armeabi and armeabi-v7a. I converted the project into a library and used it one of my another project. Since it was a small project i didn't needed to explore the converted library project. This is due to the referencing of the .so files or library files related to the Eclipse updates. I am still unsure how to configure the .so files into the build path so that there is no "Unsatisfied link" error.

Please see the screenshot attached for the Build Path of this project.
[ATTACH=CONFIG]25491[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
VansiKrishna
New Contributor II
Vansi,

I've also seen similar problems occur randomly on different machines, and including non-ArcGIS Runtime projects when using Eclipse.

I have a few suggestions:
- This may be obvious, but just in case, did you try the following?
     

  • Android Tools > Fix Project Properties > Clean

  • ArcGIS Tools > Fix Project Properties > Clean

- Check your Java Build Path > Order and Export settings and make sure that at least the ArcGIS for Android 10.1.1 is checked > "OK" > re-clean your project > rebuild > run. On my builds I make sure that the Android SDK is before the ArcGIS Runtime (in terms of the order)

- Note you can also add missing files under the Java Build Path > Libraries tab. See this StackOverflow page.

-Andy



Hello Andy,

Thanks for your options. I tried them out but didnt work out. However the problem was with the target device i was installing the app into. This ArcGIS app doesn't run in the emulators especially the Intel x86-system emulators. It should be an API level 15 ARM-eabi-v7a emulator. Also it works brilliantly in the real device. So thats the answer...

View solution in original post

0 Kudos
4 Replies
AndyGup
Esri Regular Contributor
Vansi,

I've also seen similar problems occur randomly on different machines, and including non-ArcGIS Runtime projects when using Eclipse.

I have a few suggestions:
- This may be obvious, but just in case, did you try the following?
     

  • Android Tools > Fix Project Properties > Clean

  • ArcGIS Tools > Fix Project Properties > Clean


- Check your Java Build Path > Order and Export settings and make sure that at least the ArcGIS for Android 10.1.1 is checked > "OK" > re-clean your project > rebuild > run. On my builds I make sure that the Android SDK is before the ArcGIS Runtime (in terms of the order)

- Note you can also add missing files under the Java Build Path > Libraries tab. See this StackOverflow page.

-Andy
0 Kudos
VansiKrishna
New Contributor II
Vansi,

I've also seen similar problems occur randomly on different machines, and including non-ArcGIS Runtime projects when using Eclipse.

I have a few suggestions:
- This may be obvious, but just in case, did you try the following?
     

  • Android Tools > Fix Project Properties > Clean

  • ArcGIS Tools > Fix Project Properties > Clean

- Check your Java Build Path > Order and Export settings and make sure that at least the ArcGIS for Android 10.1.1 is checked > "OK" > re-clean your project > rebuild > run. On my builds I make sure that the Android SDK is before the ArcGIS Runtime (in terms of the order)

- Note you can also add missing files under the Java Build Path > Libraries tab. See this StackOverflow page.

-Andy



Hello Andy,

Thanks for your options. I tried them out but didnt work out. However the problem was with the target device i was installing the app into. This ArcGIS app doesn't run in the emulators especially the Intel x86-system emulators. It should be an API level 15 ARM-eabi-v7a emulator. Also it works brilliantly in the real device. So thats the answer...
0 Kudos
AndyGup
Esri Regular Contributor
Vansi,

Awesome, glad you got it taken care of. If you have a moment, I have a few more questions that may help others on the forum.

>>However the problem was with the target device i was installing the app into.

Can you please clarify this, did the error you posted occur while trying to run the app on the emulator? Or, if you are referring to particular smartphone or table, please post the make, model and OS number?

>>This ArcGIS app doesn't run in the emulators especially the Intel x86-system emulators.

Did you try the steps listed here? http://blogs.esri.com/esri/arcgis/2012/05/02/arcgis-runtime-sdk-for-android-v1-1-supports-android-em...

-Andy
0 Kudos
VansiKrishna
New Contributor II
Vansi,

Awesome, glad you got it taken care of. If you have a moment, I have a few more questions that may help others on the forum.

>>However the problem was with the target device i was installing the app into.

Can you please clarify this, did the error you posted occur while trying to run the app on the emulator? Or, if you are referring to particular smartphone or table, please post the make, model and OS number?

>>This ArcGIS app doesn't run in the emulators especially the Intel x86-system emulators.

Did you try the steps listed here? http://blogs.esri.com/esri/arcgis/2012/05/02/arcgis-runtime-sdk-for-android-v1-1-supports-android-em...

-Andy


Hello Andy,

I have the answers to your questions.
Answer 1. I always use the Intel x86-emulators for my programming in the Android environment, because they are fast in execution. Moreover i have installed the Intel Hardware Acceleration Manager to support the x86-emulators in performance. After installing the ArcGIS Android SDK, i tried to run the sample applications on the same x86-emulators. It had graphic acceleration support, open gl es etc. The sample app should have run, but it didnt. After long search i posted the question on forums. Later someone suggested that the app should be run in a real device. I tried and it run successfully.

Answer 2. Later i came across the above link to run the arcgis samples on emulators. I followed the link and i discovered that i had followed the same steps except choosing the right kind of emulator. It was mentioned that the emulator should be of ARM-eabi-v7a type. I tested the app again on a similar emulator and it worked perfectly.

To summarize all of this, my sample app didnt work because i chose the wrong emulator and didnt test it on a real device. Badly my mistake it is...
0 Kudos