MFlisar / GDPRDialog

GDPR fragment dialog implementation
Apache License 2.0
211 stars 53 forks source link

Crash report #63

Closed Luklek closed 6 years ago

Luklek commented 6 years ago
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{xxxx.xxxx.xxxxx.xxxx/theme.ui.activity.DemoGDPRActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2419)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2479)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1347)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5420)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'void android.os.Bundle.setClassLoader(java.lang.ClassLoader)' on a null object reference
com.michaelflisar.gdprdialog.helper.GDPRViewManager. (GDPRViewManager.java:71)
com.michaelflisar.gdprdialog.GDPRActivity.onCreate (GDPRActivity.java:30)
android.app.Activity.performCreate (Activity.java:6280)
android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1107)
android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2372)
android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2479)
android.app.ActivityThread.-wrap11 (ActivityThread.java)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1347)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:5420)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:726)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:616)
Luklek commented 6 years ago

The above crash is reported only on Nexus 4 with Android 6.0.1 so far.

MFlisar commented 6 years ago

Are you using https://github.com/MFlisar/GDPRDialog/blob/0d2261c67c777cb044d8b3b1d3e26d3fe8273854/library/src/main/java/com/michaelflisar/gdprdialog/GDPRActivity.java#L20 to start the activity?

Seems like the arguments are missing, in which case there would not be a graceful way to handle this...

Luklek commented 6 years ago

I am using BottomSheet dialog: GDPR.getInstance().showDialog(this, mSetup, data.getLocation());

Not using startActivityForResult anywhere.

But that's the stacktrace I get in Crashlytics (Nexus 4 with Android 6.0.1)

MFlisar commented 6 years ago

In this case there is no way this can happen based on your code.

The activity is registered in the manifest and merged into your apps manifest, but it will never be used...

Maybe someone is trying to start it via an intent manually and that's why this crash happens? I've no idea how else this can happen...