Google Play Console is reporting a minute percentage of my users are getting a ClassNotFoundException upon app launch. The mystery is, which is the class that cannot be found? Well, the Stacktrace is supposed to state the name, but in these cases it is missing the name. The following is the trace, which is being sent by multiple devices:
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication(LoadedApk.java:507)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4720)
at android.app.ActivityThread.access$1500(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1343)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Method.java:0)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(NativeStart.java:0)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:982)
at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
As you can see, the standard "Didn't find class "xx.yy.zz" message is missing!
Any ideas?
i just created an account to ask something so i couldn't help you by a comment:) sorry to make this little hint as an answer.
the last exception without a cause is the interesting one.
my answer despite the data you shared from your project is to look after the line "Caused by: java.lang.ClassNotFoundException:" in your log output, just below that line goto "BaseDexClassLoader.java:56" by clicking on it, it's the first line in its stack trace ,this line tells you the class and method where the exception with no cause occurred as well as its file and line number, i am pretty sure you will find more clues searching from there as that place is probably caused the main problem.
Related
I created a game on Unity for Android. I got this error when uploading an update of my build on Google Play:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.messaging/com.google.android.apps.messaging.ui.conversationlist.ShareIntentActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
I only changed the sound volume in the update, so I guess the issue was already there in the previous builds but not detected.
I used visual scripting. I only have5 scripts downloaded from internet:
to allow to take a screenshot and share it on a platform when
pressing a button
to adapt the game to the screen resolution of the device
to authenticate to Google Play and send the score to the leaderboard
to trigger an event when the Unity ad did finish
to keep playing the music when reloading the scene
Here is the detail of the issue:
FATAL EXCEPTION: main
Process: com.google.android.apps.messaging, PID: 30735
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.messaging/com.google.android.apps.messaging.ui.conversationlist.ShareIntentActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2805)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2883)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1613)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f08014a
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:229)
at android.content.res.Resources.getDrawableForDensity(Resources.java:876)
at android.content.res.Resources.getDrawable(Resources.java:819)
at android.content.Context.getDrawable(Context.java:605)
at ym.a(PG:15)
at com.google.android.apps.messaging.ui.common.ListEmptyView.a(PG:5)
at nog.c(PG:20)
at cy.b(PG:48)
at nol.b(PG:15)
at android.support.v4.app.Fragment.g(PG:120)
at em.f(PG:71)
at ee.a(PG:447)
at ee.c(PG:436)
at ee.d(PG:395)
at ee.a(PG:427)
at ee.b(PG:327)
at ee.a(PG:535)
at ee.c(PG:217)
at ee.c(PG:109)
at ee.i(PG:61)
at di.onStart(PG:114)
at ma.onStart(PG:128)
at vit.onStart(PG:60)
at lkx.onStart(PG:33)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7033)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2768)
... 9 more
I am not a programmer so I don't know where to start. The error is about com.google.android.apps.messaging/com.google.android.apps.messaging.ui.conversationlist.ShareIntentActivity
So maybe it is related to script to share a screenshot?
Thank you!
I got the same error just now, complaining about that exact resource ID 0x7f08014a. It's not an error in your app. Looks like Google has some resource bug in their messaging app.
If you view the test-run video, I believe you will see something like Google's messaging app being started. Perhaps from a share button?
I'm experiencing this issue when updating to the installreferrer library v2.0. LINK
So when I call to the library's startConnection method it throws:
Process: com.tomatedigital.lottogram, PID: 13424
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/aidl/BaseStub;
at com.android.installreferrer.api.InstallReferrerClientImpl.startConnection(InstallReferrerClientImpl.java:36)
at com.tomatedigital.lottogram.app.App.saveReferralInfo(App.java:221)
at com.tomatedigital.lottogram.app.App.onCreate(App.java:102)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1182)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
I think it is a bug in the library, since if you downgrade to previous versions it works great. I'd like to avoid this crash.
I've tried wrapping the code with a :
catch(Throwable ignore){}
But it keeps crashing. How can I gracefully handle this error?
Short answer: You cannot really gracefully handle this error.
Why? You are still trying to use some stuff out of this library, so it makes no sense in handling this error. Either you remove this library (because you don't need it) or the error itself (classpath issues) must be resolved.
Typically, exceptions like this are critical and you should not try to handle it, because you have a serious error.
I am trying to run my app is stopping and I am getting like
E/AndroidRuntime: FATAL EXCEPTION: main
Process: koti.fcmdbreadwrite, PID: 2297
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{koti.fcmdbreadwrite/koti.fcmdbreadwrite.MainActivity}:
java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process koti.fcmdbreadwrite. Make sure to call FirebaseApp.initializeApp(Context) first.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2548)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
The error you posted tells you not only what went wrong, but it even tells you exactly how to fix it.
The problem is:
Default FirebaseApp is not initialized in this process
The solution is:
Make sure to call FirebaseApp.initializeApp(Context) first.
Before you interact with Firebase, you need to call FirebaseApp.initializeApp(). If you do that, this crash will not occur.
I'm using unirest to get a camfind result.
The full error log :
04-14 18:24:39.574 1880-2300/projectco.project E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-120
Process: projectco.project, PID: 1880
java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/naming/ldap/LdapName;
at com.mashape.relocation.conn.ssl.AbstractVerifier.extractCNs(AbstractVerifier.java:277)
at com.mashape.relocation.conn.ssl.AbstractVerifier.getCNs(AbstractVerifier.java:265)
at com.mashape.relocation.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:157)
at com.mashape.relocation.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:140)
[...] more "at"s
at bookshotco.bookshot2.MainActivity$1.run(MainActivity.java:100)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.naming.ldap.LdapName" on path: DexPathList[[zip file "/data/app/projectco.project-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
[..]
Suppressed: java.lang.ClassNotFoundException: javax.naming.ldap.LdapName
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 23 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Few people had this problem and even fewer solved it, most of the times using stuff to do with compatibility of different versions which did not work for me.
The emulator I'm using is up to date (nexus 5 on api 21).
I've recently had the same issue and it was only happening in obfuscated code. So keeping the whole org.apache package in Proguard rules solved the issue.
# Keep Apache Package, since it cannot find some of the classes and throws Verify Error
-keep class org.apache.** {*;}
This error can also be caused by requiring ssl (i.e., "useSSL") when connecting to a remote server and NOT having verifyServerCertificate and trustServerCertificate defined as below, and also not having a server certificate defined properly. The system is trying to use an LDAP authentication process, thus the error.
val info = Properties()
info.setProperty("useSSL", "true")
info.setProperty("requireSSL", "true")
info.setProperty("user", user)
info.setProperty("password", password)
info.setProperty("verifyServerCertificate", "false")
info.setProperty("trustServerCertificate", "true")
Also, if you define:
trustServerCertificate=false
then you may need to set the following (unless everything matches up):
disableSslHostnameVerification=true
i am getting this error inside Google's "Crashes & ANRs". The application built with Adobe Air and packaged as captive runtime.
java.lang.UnsatisfiedLinkError: nativeSurfaceCreated
at com.adobe.air.AIRWindowSurfaceView.nativeSurfaceCreated(Native Method)
at com.adobe.air.AIRWindowSurfaceView.surfaceCreated(AIRWindowSurfaceView.java:719)
at android.view.SurfaceView.updateWindow(SurfaceView.java:545)
at android.view.SurfaceView.access$000(SurfaceView.java:81)
at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:169)
at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:693)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1731)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2583)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4508)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
Does anybody know what this means?
The UnsatisfiedLinkError for Java usually means that you tried to load a library called nativeSurfaceCreated. Basically your code called a method that called a method and so on, and some code somebody else wrote called a native method. This native method loaded a library called nativeSurfaceCreated, which you don't have. This is usually packaged in a dll in Windows or a so file in Linux. If you can find this dll/so file, you can probably run whatever you're running.