Rifluxyss / acra

Automatically exported from code.google.com/p/acra
0 stars 0 forks source link

NPE at org.acra.CrashReportingApplication.initAcra() #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
As reported for my Android App - HireADroid. Stack trace follows

java.lang.RuntimeException: Unable to create application 
bostone.android.hireadroid.HireADroidApplication: java.lang.NullPointerException
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4247)
at android.app.ActivityThread.access$3000(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at 
org.acra.CrashReportingApplication.initAcra(CrashReportingApplication.java:178)
at 
org.acra.CrashReportingApplication.onCreate(CrashReportingApplication.java:169)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)
... 10 more

Original issue reported on code.google.com by bost...@gmail.com on 22 Nov 2010 at 5:52

GoogleCodeExporter commented 8 years ago
What is your version of ACRA ? From the stack trace I would guess it is 
2.1.0-test but I can't see how line 178 of CrashReportingApplication could 
throw a NPE. 
http://code.google.com/p/acra/source/browse/tags/REL-2_1_0-test/CrashReport/src/
org/acra/CrashReportingApplication.java#178

Anyway, you would better use ACRA v3, the 2.* branch will not be maintained 
anymore.

Original comment by kevin.gaudin on 22 Nov 2010 at 11:02

GoogleCodeExporter commented 8 years ago
Just noticed you're using Instrumentation to test your Application. I don't 
know much about this, but it looks like in this mode the real Application is 
not run in its usual context so I may understand that 
Application.getPackageName() could return null if 
http://developer.android.com/intl/fr/guide/topics/manifest/instrumentation-eleme
nt.html#trgt is not set ?

Original comment by kevin.gaudin on 22 Nov 2010 at 11:16

GoogleCodeExporter commented 8 years ago
Ok, I can reproduce the NPE with a simple test case with ACRA v3 as well. 
Working on it.

Original comment by kevin.gaudin on 22 Nov 2010 at 11:54

GoogleCodeExporter commented 8 years ago
Finally, that was a different NPE... the one I throw on purpose to test 
ACRA.... Now unit-test runs ok without any NPE on the ACRA side with ACRAv3.

Original comment by kevin.gaudin on 23 Nov 2010 at 12:06

GoogleCodeExporter commented 8 years ago
This issue was reported on an outdated version. It is even more outdated now.

Original comment by kevin.gaudin on 7 Sep 2012 at 9:49