we've published our app a few days ago on Play Store. Since then, every day, we see a short burst of crashes in Crashlytics. It takes about an hour, and it generates over 200 crashes. All with same stack trace, from different devices, and all devices are rooted.
Stack trace is this (redacted):
Fatal Exception: java.lang.UnsatisfiedLinkError: Cannot load library: get_lib_extents[742]: 795 - /data/data/our.app/lib/libsomething.so is not a valid ELF object
at java.lang.Runtime.loadLibrary(Runtime.java:370)
at java.lang.System.loadLibrary(System.java:535)
Has anyone f you seen something like that? What is it?
Related
I've noticed an increase in the number of StackOverflow crashes in my app which all seem to point back to Google Play Services Maps. I am currently using version 15.0.1 (com.google.android.gms:play-services-maps:15.0.1) - but this started about two weeks ago when I was still using 15.0.0. There are several crashes, but they all result in StackOverflows when dealing with Hashmaps or Arrays from the Maps code (which is obfuscated). Some examples of the crashes (I just copied the stack traces to the point where it goes to the obfuscated maps code):
Fatal Exception: java.lang.StackOverflowError: stack size 1038KB
at java.util.HashMap.remove(HashMap.java:617)
at com.google.maps.api.android.lib6.gmm6.util.e.d(:com.google.android.gms.dynamite_dynamitemodulesb#12685021#12.6.85 (040306-197041431):29)
Fatal Exception: java.lang.StackOverflowError
at java.util.ArrayList$ArrayListIterator.(ArrayList.java:551)
at java.util.ArrayList.iterator(ArrayList.java:548)
at java.util.Collections$UnmodifiableCollection$1.(Collections.java:953)
at java.util.Collections$UnmodifiableCollection.iterator(Collections.java:952)
at com.google.maps.api.android.lib6.common.i.iterator(:com.google.android.gms.dynamite_dynamitemodulesb#12685002#12.6.85 (000304-197041431):25)
Fatal Exception: java.lang.StackOverflowError: stack size 8MB
at java.util.HashMap.createEntry(HashMap.java:826)
at java.util.HashMap.addEntry(HashMap.java:813)
at java.util.HashMap.put(HashMap.java:436)
at com.google.maps.api.android.lib6.gmm6.util.e.b(:com.google.android.gms.dynamite_dynamitemodulesb#12685020#12.6.85 (040304-197041431):17)
Fatal Exception: java.lang.StackOverflowError: stack size 8MB
at java.util.HashMap.removeEntryForKey(HashMap.java:597)
at java.util.HashMap.remove(HashMap.java:584)
at com.google.maps.api.android.lib6.gmm6.util.e.d(:com.google.android.gms.dynamite_dynamitemodulesb#12685023#12.6.85 (040400-197041431):29)
Fatal Exception: java.lang.StackOverflowError: stack size 8MB
at java.util.ArrayList.(ArrayList.java:170)
at com.google.maps.api.android.lib6.common.i.(:com.google.android.gms.dynamite_dynamitemodulesb#12685020#12.6.85 (040304-197041431):9)
I also have a number of other crashes directly inside the obfuscated maps code.
Some other information: the maps are not inside the main flow of my app, so it is only used by about 8% of my users - around 200 or so calls a day. Today is by far the worst with 62 crashes affecting 13 users - two days ago it was 42 crashes and most other days I have zero crashes.
Operating system versions affected: 7.0, 6.0.1, 4.4.2, 7.1.1, 4.1.2, 5.1, 4.3
Devices: Samsung, Sony, Lenovo, Moto E3 (whatever that is) and a Huawei.
Any help or pointers would be useful!
I have an Android app with Dropbox support. Lately I've started getting an exception for some users. I can not reproduce it. It affects just a few users. The exception happens when Dropbox tries to access /sdk-version.txt which is one of their resources. On Android Studio I can see the resource is there, here is a screenshot:
And like I said, it doesn't happen for me or for most of my users. If I use apktool on my apk, the sdk-version.txt file shows up on a folder called unknown. I see a lot of other files there but most have a package, this one doesn't. Not sure if that matters.
I also have this line on my gradle file multiDexKeepFile file('multidex-config.txt') and in there I have:
com.dropbox.core.DbxRequestUtil
com.dropbox.core.http.HttpRequestor
com.dropbox.core.DbxSdkVersion
Those were all attempts at fixing this but it didn't help.
So far the exception has happened on Android 5 and 6 across multiple manufacturers. This is the exception:
Fatal Exception: java.lang.ExceptionInInitializerError
at com.dropbox.core.DbxRequestUtil.buildUserAgentHeader(DbxRequestUtil.java:151)
at com.dropbox.core.DbxRequestUtil.addUserAgentHeader(DbxRequestUtil.java:136)
at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:233)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:107)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:284)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:102)
at com.dropbox.core.v2.users.DbxUserUsersRequests.getCurrentAccount(DbxUserUsersRequests.java:120)
at mypackage.UserDropbox.(UserDropbox.java)
at mypackage.DropboxHelper$1.run(DropboxHelper.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:81smiling face with sunglasses
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void java.util.jar.JarVerifier.removeMetaEntries()' on a null object reference
at java.util.jar.JarFile.getInputStream(JarFile.java:381)
at libcore.net.url.JarURLConnectionImpl.getInputStream(JarURLConnectionImpl.java:222)
at java.net.URL.openStream(URL.java:470)
at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:444)
at java.lang.Class.getResourceAsStream(Class.java:1412)
at com.dropbox.core.DbxSdkVersion.loadLineFromResource(DbxSdkVersion.java:34)
at com.dropbox.core.DbxSdkVersion.loadVersion(DbxSdkVersion.java:56)
at com.dropbox.core.DbxSdkVersion.(DbxSdkVersion.java)
at com.dropbox.core.DbxRequestUtil.buildUserAgentHeader(DbxRequestUtil.java:151)
at com.dropbox.core.DbxRequestUtil.addUserAgentHeader(DbxRequestUtil.java:136)
at com.dropbox.core.DbxRequestUtil.startPostRaw(DbxRequestUtil.java:233)
at com.dropbox.core.v2.DbxRawClientV2$1.execute(DbxRawClientV2.java:107)
at com.dropbox.core.v2.DbxRawClientV2.executeRetriable(DbxRawClientV2.java:284)
at com.dropbox.core.v2.DbxRawClientV2.rpcStyle(DbxRawClientV2.java:102)
at com.dropbox.core.v2.users.DbxUserUsersRequests.getCurrentAccount(DbxUserUsersRequests.java:120)
at mypackage.UserDropbox.(UserDropbox.java)
This isn't a direct solution.
You can integrate fabric clashlytics into your app to get a full report on the cause of the exception and information on the type and OS of devices experiencing the Exception.
I had been working with the SpotifyAPI for a long time, but randomly it just started to crash on me whenever it trys to load the player. Here is the error I get
12-22 20:20:01.995 28130-28130/com.skyrealm.brockyy.spotifyapi E/AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.skyrealm.brockyy.spotifyapi-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libgnustl_shared.so"
The line of code that I get this error in is
Spotify.getPlayer(playerConfig, this, new Player.InitializationObserver() {
Thank you for your time!
- Rockyfish
I think you might have just hit the 64k method limit
This is when the amount of code you have (including libraries) is more than Android usually packs into a dex file aka your apk. There is a solution
Try this to resolve the solution:
http://developer.android.com/tools/building/multidex.html
fyi it's sad when you hit this limit :-( and usually there is usused code in your project that could do with pruning to tidy it up (including unused library code).
The other possibility is you're writie native (NDK) code, and I can't help you so much with that :)
Background
Recently I've updated my app, and for some reason Proguard seem to ruin the code I've made, causing crashes on a very specific case, even though I didn't add any additional libraries.
The reason I'm so sure it's Proguard's fault is that when I tested it without exporting it, it ran fine.
The problem
After seeing the crash reports' stack traces (and seeing that it does occur, by myself), I've ran the "proguardgui" tool and chose to retrace using the mapping file.
Sadly, instead of showing the real places that the code failed, it showed the exact same stack. I've tried to export the project again and use a new mapping file that was created by it, but I still get the same obfuscated stack trace.
Not only that, but the exception itself is very problematic: java.lang.NoClassDefFoundError .
Here's the stack trace, though I don't think it's readable:
java.lang.NoClassDefFoundError: com.lb.app_manager.utils.r
at com.lb.app_manager.utils.e.c(Unknown Source)
at com.lb.app_manager.activities.app_list_activity.AppListActivity.onContextItemSelected(Unknown Source)
at android.app.Activity.onMenuItemSelected(Activity.java:2620)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(Unknown Source)
at com.actionbarsherlock.app.SherlockFragmentActivity.onMenuItemSelected(Unknown Source)
at com.android.internal.policy.impl.PhoneWindow$DialogMenuCallback.onMenuItemSelected(PhoneWindow.java:3864)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.MenuDialogHelper.onClick(MenuDialogHelper.java:167)
at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:941)
at android.widget.AdapterView.performItemClick(AdapterView.java:299)
at android.widget.AbsListView.performItemClick(AbsListView.java:1113)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:2904)
at android.widget.AbsListView$3.run(AbsListView.java:3638)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:133)
at dalvik.system.NativeStart.main(Native Method)
This occurs when I choose to share an app, which, for a very short time should show a progress dialog while running an AsyncTask, and then show a dialog of how you wish to share (just like on the screenshot of the play store link, available here in case you can't see it ).
What I've tried
I've tried to add logs in multiple places, and found out that the AsyncTask runs fine, but it doesn't reach "onPostExecute". I know this since I've put log at the end of "doInBackground" and at the beginning of "onPostExecute" .
This got even weirder, when I removed most of the code of "onPostExecute" and now I have only this:
protected void onPostExecute(final Void result)
{
Log.d("Applog","onPostExecute 0");
super.onPostExecute(result);
Log.d("Applog","onPostExecute 1");
progressDialog.dismiss();
}
It doesn't even reach the first line this way.
In the end, I've decided to merge 2 projects (that I made several versions ago), so that there won't be any Android library project that I made. Only a single one.
I've also removed a library that appears not being used (of Apache commons), but I can't believe this is the cause to the problem (because I didn't use it).
The question
Why do such problems occur?
How can I avoid such a problem in the future?
A NoClassDefFoundError generally points to a problem in the build process: some class that is required doesn't end up in your application.
ProGuard prints out information in the build log about the input jars that it reads and the output jars that it writes. You can also specify
-printconfiguration configuration.txt
to get the complete configuration that ProGuard uses, including input and output. This should help you to find out if all expected input jars are present.
If you are using Eclipse to build your application, you may have run into a synchronization problem that seems to run ProGuard when not all compiled files have been written to disk yet. This mysterious problem has been reported a few times, but it is still unsolved. You should then try Ant or Gradle instead.
We have a game released in google play with many users playing it.
We keep getting crash reports (not so many) in google play that say that cococs2dcpp could not be loaded. Any idea what might cause it for some of the users?
(We have read online that it can be something related to simulators but it seems these crash reports are coming from real users on mobile devices that say in the crash report comment that the game does not open anymore)
java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myproduct-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.myproduct-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:355)
at java.lang.System.loadLibrary(System.java:525)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:429)
at java.lang.System.loadLibrary(System.java:554)
So far it is reported from these devices
Galaxy Note 8.0 (konawifi)
Xperia SP (C5303)
Xperia V (LT25i)
nuclear-jw9a702
Galaxy S2 Plus (s2vep)
Galaxy Note 8.0 (kona3g)
Galaxy S Stratosphere (SCH-I405)
You need to run the command line script from the proj.android folder - python build_native.py. This generates the library you're missing.