question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application crash on ACRA.init()

See original GitHub issue

Issue Description

Hello, I’m trying to integrate ACRA 4.9.2, and I believe I’ve followed all your instructions.

I am building with ant, and put the acra.jar (from the aar) inside the libs folder, and it does compile ,and ACRA.init() is getting called. But the ‘org.acra.dialog.CrashReportDialog’ seems missing, even though I do see it in the classes.dex .

The log is:

E/AndroidRuntime( 3311): java.lang.NoClassDefFoundError: org.acra.dialog.CrashReportDialog
E/AndroidRuntime( 3311): 	at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
E/AndroidRuntime( 3311): 	at java.lang.Class.getDexCacheType(Class.java:479)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:705)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.getDefaultValue(AnnotationAccess.java:361)
E/AndroidRuntime( 3311): 	at java.lang.reflect.Method.getDefaultValue(Method.java:327)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationFactory.getElementsDescription(AnnotationFactory.java:75)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationFactory.<init>(AnnotationFactory.java:112)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationFactory.createAnnotation(AnnotationFactory.java:94)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:666)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
E/AndroidRuntime( 3311): 	at libcore.reflect.AnnotationAccess.getAnnotation(AnnotationAccess.java:72)
E/AndroidRuntime( 3311): 	at java.lang.Class.getAnnotation(Class.java:344)
E/AndroidRuntime( 3311): 	at org.acra.ACRA.init(ACRA.java:135)
E/AndroidRuntime( 3311): 	at com.lifevu.webview.Application.attachBaseContext(Application.java:57)
E/AndroidRuntime( 3311): 	at android.app.Application.attach(Application.java:181)
E/AndroidRuntime( 3311): 	at android.app.Instrumentation.newApplication(Instrumentation.java:996)
E/AndroidRuntime( 3311): 	at android.app.Instrumentation.newApplication(Instrumentation.java:980)
E/AndroidRuntime( 3311): 	at android.app.LoadedApk.makeApplication(LoadedApk.java:559)
E/AndroidRuntime( 3311): 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4566)
E/AndroidRuntime( 3311): 	at android.app.ActivityThread.access$1600(ActivityThread.java:154)
E/AndroidRuntime( 3311): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
E/AndroidRuntime( 3311): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3311): 	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 3311): 	at android.app.ActivityThread.main(ActivityThread.java:5294)
E/AndroidRuntime( 3311): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3311): 	at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 3311): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
E/AndroidRuntime( 3311): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
E/AndroidRuntime( 3311): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.acra.dialog.CrashReportDialog" on path: DexPathList[[zip file "/data/app/com.lifevu.webview-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
E/AndroidRuntime( 3311): 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime( 3311): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
E/AndroidRuntime( 3311): 	at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
E/AndroidRuntime( 3311): 	at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
E/AndroidRuntime( 3311): 	... 28 more
E/AndroidRuntime( 3311): 	Suppressed: java.lang.NoClassDefFoundError: org.acra.dialog.CrashReportDialog
E/AndroidRuntime( 3311): 		at dalvik.system.DexFile.defineClassNative(Native Method)
E/AndroidRuntime( 3311): 		at dalvik.system.DexFile.defineClass(DexFile.java:226)
E/AndroidRuntime( 3311): 		at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
E/AndroidRuntime( 3311): 		at dalvik.system.DexPathList.findClass(DexPathList.java:321)
E/AndroidRuntime( 3311): 		at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
E/AndroidRuntime( 3311): 		... 31 more
E/AndroidRuntime( 3311): 	Suppressed: java.lang.ClassNotFoundException: org.acra.dialog.CrashReportDialog
E/AndroidRuntime( 3311): 		at java.lang.Class.classForName(Native Method)
E/AndroidRuntime( 3311): 		at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
E/AndroidRuntime( 3311): 		at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
E/AndroidRuntime( 3311): 		at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
E/AndroidRuntime( 3311): 		... 30 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ronaaroncommented, May 11, 2017

Thank you! The support-v4 was the real problem. I don’t know how I missed that.

0reactions
F43nd1rcommented, May 11, 2017

Second, the problem here is that you are not fulfilling acras dependencies, specifically support-v4. Relevant stacktrace excerpt is Caused by: java.lang.ClassNotFoundException: Didn’t find class “android.support.v4.app.FragmentActivity” on path: DexPathList[[zip file “/data/app/com.test.me-1/base.apk”],nativeLibraryDirectories=[/data/app/com.test.me-1/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at java.lang.reflect.Method.getDefaultValue(Native Method)  at libcore.reflect.AnnotationFactory.getElementsDescription(AnnotationFactory.java:75)  at libcore.reflect.AnnotationFactory.(AnnotationFactory.java:112)  at libcore.reflect.AnnotationFactory.createAnnotation(AnnotationFactory.java:94)  at java.lang.Class.getDeclaredAnnotation(Native Method)  at java.lang.Class.getAnnotation(Class.java:2352)  at org.acra.ACRA.init(ACRA.java:135)  at com.test.me.Application.attachBaseContext(Application.java:50)

So, to solve your problem, add support-v4 to your libs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where should I place ACRA.init(this);? - Stack Overflow
init (this); in public void onCreate() . It works for me while I test. Nonetheless, when I released the app, I already saw...
Read more >
ACRA (Automated Crash Reporting for Android)
Here we go Application Crash Reporting on Android (ACRA), ... A call to ACRA.init() from onCreate(), to initialize the ACRA crash detection subsystem...
Read more >
org.acra.ACRA.init java code examples - Tabnine
Initialize ACRA for a given Application. The call to this method should be placed as soon as possible in the Application#attachBaseContext(Context) method. Uses ......
Read more >
ACRA (Application Crash Report for Android 4.9.2 API)
Use this class to initialize the crash reporting feature using init(Application) as soon as possible in your Application subclass Application.onCreate() ...
Read more >
Prevent App crashing in Android using ACRA - Inextrix
ACRA stands for Application Crash Reporting on Android (ACRA). ... and then override the attachBaseContext() method to add ACRA.init(this); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found