6

I'm developing an Android application that uses a huge native library. Some customers are complaining about a crash at startup, one of them gave us his logcat dump:

07-19 10:55:15.139 E/AndroidRuntime(16539)FATAL EXCEPTION: AsyncTask #3
07-19 10:55:15.139 E/AndroidRuntime(16539)java.lang.RuntimeException: An error occured while executing doInBackground()
07-19 10:55:15.139 E/AndroidRuntime(16539)at android.os.AsyncTask$3.done(AsyncTask.java:200)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.FutureTask.run(FutureTask.java:138)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.lang.Thread.run(Thread.java:1019)
07-19 10:55:15.139 E/AndroidRuntime(16539)Caused by: java.lang.ExceptionInInitializerError
07-19 10:55:15.139 E/AndroidRuntime(16539)at my.app.appinit.NativeInitAsyncTask.doInBackground(NativeInitAsyncTask.java:86)
07-19 10:55:15.139 E/AndroidRuntime(16539)at my.app.appinit.NativeInitAsyncTask.doInBackground(NativeInitAsyncTask.java:44)
07-19 10:55:15.139 E/AndroidRuntime(16539)at android.os.AsyncTask$2.call(AsyncTask.java:185)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
07-19 10:55:15.139 E/AndroidRuntime(16539)... 4 more
07-19 10:55:15.139 E/AndroidRuntime(16539)Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1935]:    94 missing essential tables
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.lang.Runtime.loadLibrary(Runtime.java:434)
07-19 10:55:15.139 E/AndroidRuntime(16539)at java.lang.System.loadLibrary(System.java:554)
07-19 10:55:15.139 E/AndroidRuntime(16539)at nativewrapper.NativeObject.<clinit>(NativeObject.java:30)
07-19 10:55:15.139 E/AndroidRuntime(16539)... 8 more
07-19 10:55:15.179 W/ActivityManager(162)Force finishing activity my.app.packagename/my.app.FirstActivity

The customer's phone model is Samsung Galaxy Ace (gt-s5830). By digging on internet, I found this piece of code from the Android linker (http://source-android.frandroid.com/bionic/linker/linker.c): looking at it, It seems that zygote (pid 94) can't load the library for my application (pid 1935), I can't find any hint or a workaround to fix this, any idea? Thanks.

spacifici
  • 2,186
  • 2
  • 16
  • 28

2 Answers2

0

Update your application build with latest ndk release.

java.lang.UnsatisfiedLinkError

The exception occurs because the native library (DLL on Windows/ SO for linux) cannot be found. On UNIX and other systems, it can also be caused by a version difference between the run-time libraries on the system and the run-time libraries associated with with pre-built native libraries.

Ajay Kumar Meher
  • 1,932
  • 16
  • 24
0

This seems to be an error in your static block to "LOAD A LIBRARY".

Check these things

  1. remove the "lib" from starting and ".so" from the end of the library name. for eg: if library is libTest.so

your code inside static block should be

static{

System.loadLibrary("Test");

}
  1. Make sure you clean your project.
cafebabe1991
  • 4,928
  • 2
  • 34
  • 42