Re: java.lang.UnsatisfiedLinkError crash on startup for some Android devices

5,369 views
Skip to first unread message

eric liou

unread,
Feb 22, 2013, 2:14:41 AM2/22/13
to andro...@googlegroups.com
where is the libbrickgame.so ?

On Thu, Feb 21, 2013 at 6:09 PM, <nataliegl...@gmail.com> wrote:
> Please we need help with a very strange error.
>
> For some reasons, our app didn't work on some devices. In our Developer
> Console, we regularly see a few reports per week for
> java.lang.UnsatisfiedLinkError. From the stack trace and the 1-star rating
> comments, it seems that the app just crash on startup with a black screen
> because Android cannot find the C++ game library.
>
> The strange thing is this only happen to some devices. The game work on most
> devices just fine… most of our 1-star ratings are from this particular
> crash.
>
> I wonder if anyone know how to fix this? Thank you for your help.
>
>
> Java code in our MainActivity that load the C++ game library:
>
> static {
>
> System.loadLibrary("brickgame");
>
> }
>
>
> Stack trace from the Developer Console:
>
> java.lang.ExceptionInInitializerError
> at java.lang.Class.newInstanceImpl(Native Method)
> at java.lang.Class.newInstance(Class.java:1440)
> at android.app.Instrumentation.newActivity(Instrumentation.java:1056)
> at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1637)
> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1747)
> at android.app.ActivityThread.access$1500(ActivityThread.java:155)
> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
> at android.os.Handler.dispatchMessage(Handler.java:130)
> at android.os.Looper.loop(SourceFile:351)
> at android.app.ActivityThread.main(ActivityThread.java:3814)
> at java.lang.reflect.Method.invokeNative(Native Method)
> at java.lang.reflect.Method.invoke(Method.java:538)
> at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:659)
> at dalvik.system.NativeStart.main(Native Method)
> Caused by: java.lang.UnsatisfiedLinkError: Couldn't load brickgame:
> findLibrary returned null
> at java.lang.Runtime.loadLibrary(Runtime.java:460)
> at java.lang.System.loadLibrary(System.java:585)
> at com.brickgame.MainActivity.<clinit>(Unknown Source)
> ... 15 more
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-ndk...@googlegroups.com.
> To post to this group, send email to andro...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-ndk?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

nataliegl...@gmail.com

unread,
Feb 22, 2013, 4:59:47 AM2/22/13
to andro...@googlegroups.com
It is in the usual place: brickgame.apk/lib/armeabi/libbrickgame.so

The game definitely works in some device while not in others. I have no idea why that can happen.

Thanks

Athos Bacchiocchi

unread,
Feb 22, 2013, 6:24:32 AM2/22/13
to andro...@googlegroups.com
We are experiencing the same problem, in very rare occasions the libraries are not correctly loaded. We still don't know what's going on, but for now we are catching the java.lang.UnsatisfiedLinkError exception to put the app in an "error" state where it doesn't even try to make a jni call, and just shows an error message telling the user to try downloading the app again and report us abot the issue if she wants. In this way we are avoiding the app to crash, and hopefully lowering the one-star reviews number due to sudden and unexplained crashes.

We are collecting data from users' reports (we get around 1 report for each 2000 downloads) and the problem seems completely trasversal, happening on every kind of device (tablets, phones, any brands), for both the architectures we support (armeabi and armeabi-v7a) and for any of the android versions (from 2.3 up to 4.2).

It once happened to me after pushing the app to the phone via usb (during the normal everyday development process). I got the error and I checked into the app's lib folder on the phone, and one was missing for no apparent reason. I pushed it again and everything was back to normal. So I guess there might be some trouble during download or apk unpacking, just some hypotesis.

athos



Il 21/02/13 11.09, nataliegl...@gmail.com ha scritto:

For some reasons, our app�didn't�work on some devices. In our Developer Console, we regularly see a few reports per week for java.lang.UnsatisfiedLinkError. From the stack trace and the 1-star rating comments, it seems that the app just crash on startup with a black screen because Android cannot find the C++ game library.

The strange thing is this only happen to some devices. The game work on most devices just fine� most of our 1-star ratings are from this particular crash.

eric liou

unread,
Feb 22, 2013, 7:44:07 AM2/22/13
to andro...@googlegroups.com
nataliegladstone213's description seems different, the app not work at
all for some devices. So, it should be easier to debug for
nataliegladstone213's case.
What about write a native test program that invoke some functions in
the library?

On Fri, Feb 22, 2013 at 7:24 PM, Athos Bacchiocchi <at...@ntrack.com> wrote:
> We are experiencing the same problem, in very rare occasions the libraries
> are not correctly loaded. We still don't know what's going on, but for now
> we are catching the java.lang.UnsatisfiedLinkError exception to put the app
> in an "error" state where it doesn't even try to make a jni call, and just
> shows an error message telling the user to try downloading the app again and
> report us abot the issue if she wants. In this way we are avoiding the app
> to crash, and hopefully lowering the one-star reviews number due to sudden
> and unexplained crashes.
>
> We are collecting data from users' reports (we get around 1 report for each
> 2000 downloads) and the problem seems completely trasversal, happening on
> every kind of device (tablets, phones, any brands), for both the
> architectures we support (armeabi and armeabi-v7a) and for any of the
> android versions (from 2.3 up to 4.2).
>
> It once happened to me after pushing the app to the phone via usb (during
> the normal everyday development process). I got the error and I checked into
> the app's lib folder on the phone, and one was missing for no apparent
> reason. I pushed it again and everything was back to normal. So I guess
> there might be some trouble during download or apk unpacking, just some
> hypotesis.
>
> athos
>
>
>
> Il 21/02/13 11.09, nataliegl...@gmail.com ha scritto:
>
> For some reasons, our app didn't work on some devices. In our Developer
> Console, we regularly see a few reports per week for
> java.lang.UnsatisfiedLinkError. From the stack trace and the 1-star rating
> comments, it seems that the app just crash on startup with a black screen
> because Android cannot find the C++ game library.
>
> The strange thing is this only happen to some devices. The game work on most
> devices just fine… most of our 1-star ratings are from this particular
> crash.
>

nataliegl...@gmail.com

unread,
Feb 22, 2013, 9:07:46 PM2/22/13
to andro...@googlegroups.com

Eric and Athos:

From Athos description, he is definitely experiencing the same problem.

We got this crash report from all sort of devices as well. And the crash is definitely not unique to a specific device or OS version. We actually have a crash report from a Galaxy S2 (OS 4.0.3), a model we own and test with. It is all very strange to us.

Our app is also on Amazon, but we haven’t received a java.lang.UnsatisfiedLinkError crash report there. It could be that Amazon didn’t report this issue though.

Nat

Jeffrey Walton

unread,
Feb 22, 2013, 9:17:58 PM2/22/13
to andro...@googlegroups.com
On Fri, Feb 22, 2013 at 9:07 PM, <nataliegl...@gmail.com> wrote:
>
> ...
>
> Our app is also on Amazon, but we haven’t received a
> java.lang.UnsatisfiedLinkError crash report there. It could be that Amazon
> didn’t report this issue though.
>
Amazon forked for the Kindle, so there could be additional error
checking and recovery. I know Amazon improved some security controls.

Jeff

gadget

unread,
Feb 23, 2013, 3:46:37 AM2/23/13
to andro...@googlegroups.com
There was also the issue where 4.0.3 would not load armeabi-v7a libraries, but would instead go after armeabi ones

Arnaud Besnier

unread,
Jun 17, 2013, 9:12:05 AM6/17/13
to andro...@googlegroups.com
I exactly have the same problem that athos described in his post.
It generates a lots of bad reviews for our apps (the most of them actually)

For the user, the app crashes on startup.
For us, we received a lot of crashes in the developer console saying that kind of message :
java.lang.UnsatisfiedLinkError: Couldn't load kroll-v8: findLibrary returned null
It is not always the same lib.

We didn't success to reproduce on our devices (even on the same devices we received crash reports from)...


Le lundi 3 juin 2013 11:20:37 UTC+2, Smith John a écrit :
The problem mentioned above happened today in my application, too. 
(Some users can't access .so file.)

This only happen to some android 4.1.1 devices.
Does this problem reoccur?

2013年2月21日木曜日 19時09分12秒 UTC+9 nataliegl...@gmail.com:

Please we need help with a very strange error.

For some reasons, our app didn't work on some devices. In our Developer Console, we regularly see a few reports per week for java.lang.UnsatisfiedLinkError. From the stack trace and the 1-star rating comments, it seems that the app just crash on startup with a black screen because Android cannot find the C++ game library.

The strange thing is this only happen to some devices. The game work on most devices just fine… most of our 1-star ratings are from this particular crash. 

DroidVPN

unread,
Jun 20, 2013, 12:25:25 PM6/20/13
to andro...@googlegroups.com
I am also having the same problem. Is there any fix for this? I hope google can notice this page and do something about this.

Brandon Romano

unread,
Jun 24, 2013, 1:56:18 PM6/24/13
to andro...@googlegroups.com
Keep it in brickgame.apk/lib/armeabi/libbrickgame.so, but also place it in brickgame.apk/lib/armeabi-v7a/libbrickgame.so.  I've noticed some phones look in the first folder, and some look in the other.

张贤鹏

unread,
Apr 8, 2014, 6:33:40 AM4/8/14
to andro...@googlegroups.com

hi,all. Now, i am having the same problem as you do .  Because i can collect my crash reports of my app, i analyzed the crash reports and found that all the crashes happen in only three Android systems: 4.0.4, 4.1.1, 4.1.2. So I guess, maybe it's a bug of Android system itself. Is the same situation you have? 

在 2013年6月25日星期二UTC+8上午1时56分18秒,Brandon Romano写道:

Prashanthi Shivapooja

unread,
Apr 10, 2014, 1:02:44 AM4/10/14
to andro...@googlegroups.com
Hi Friend,
              Its due to libbrickgame.so file. u have to generate libbrickgame.so file using android-ndk. that is u have recompile code based on your ndk version and settings.
 and automatically it will be stored in lib/armeabi/ and lib/armeabi-v7a folders.

---hope u downloaded android ndk to one folder 
---open command prompt
---- goto your project folder of jni eg: cd  D:\down\samples\hello-jni
----- copy ur ndk path D:\down\android-ndk-r7-windows\android-ndk-r7\
-- so over all ur coamand prompt shd be like 


D:\down\samples\hello-jni>D:\down\android-ndk-r7-windows\android-ndk-r7\ndk-build.cmd

which will generate libbrickgame.so file.....and stores in armeabi folders.

Regards
Prashanthi


Reply all
Reply to author
Forward
0 new messages