auth0/Auth0.Android

NPE in AuthenticationActivity

RahulMarepalli opened this issue · 4 comments

Looks like in AuthenticationActivity.kt on Line 68:

private fun launchAuthenticationIntent() {
        val extras = intent.extras
        val authorizeUri = extras!!.getParcelable<Uri>(EXTRA_AUTHORIZE_URI)
        val customTabsOptions: CustomTabsOptions = extras.getParcelable(EXTRA_CT_OPTIONS)!!
        customTabsController = createCustomTabsController(this, customTabsOptions)
        customTabsController!!.bindService()
        customTabsController!!.launchUri(authorizeUri!!)
    }

val customTabsOptions: CustomTabsOptions = extras.getParcelable(EXTRA_CT_OPTIONS)!!
is causing the below crash

Non-fatal Exception: java.lang.NullPointerException:
       at com.auth0.android.provider.AuthenticationActivity.launchAuthenticationIntent(AuthenticationActivity.kt:68)
       at com.auth0.android.provider.AuthenticationActivity.onResume(AuthenticationActivity.kt:46)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1531)
       at com.compass.compass.helpers.CustomInstrumentation.access$callActivityOnResume$s-452466866(CustomInstrumentation.kt:69)
       at com.compass.compass.helpers.CustomInstrumentation$callActivityOnResume$1.invoke(CustomInstrumentation.kt:76)
       at com.compass.compass.helpers.CustomInstrumentation$callActivityOnResume$1.invoke(CustomInstrumentation.kt:76)
       at com.compass.compass.helpers.InstrumentationHandler$DefaultImpls.silenceException(CustomInstrumentation.kt:46)
       at com.compass.compass.helpers.CustomInstrumentation.silenceException(CustomInstrumentation.kt:69)
       at com.compass.compass.helpers.CustomInstrumentation.callActivityOnResume(CustomInstrumentation.kt:76)
       at android.app.Activity.performResume(Activity.java:8422)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4793)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4836)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:54)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:201)
       at android.os.Looper.loop(Looper.java:288)
       at android.app.ActivityThread.main(ActivityThread.java:7898)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Auth0 Android SDK version: 2.8.0
We are getting crashes in Firebase crashlytics. However, we are not able to find the reproduction steps yet.

Hi @RahulMarepalli, can you verify if you are using any withCustomTabsOptions and if so, can you provide the values used there? Also is there any pattern on the device environment (OS, Device Type, Manufacturer Model)

Yes, we are providing Custom Tab Options as below:

CustomTabsOptions.newBuilder()
    .withToolbarColor(android.R.color.white)
    .showTitle(false)
    .build()

Patterns on crashes:
80% : HUAWEI (BAH4-W09) - Android 10
20% : Google (Pixel 6 Pro) - Android 13

@RahulMarepalli I can see some custom code before calling the authentication activity CustomInstrumentation.access$callActivityOnResume. Not sure if the issue is originating from there. Since it is not reproducible I am not sure how we can proceed further. Is it possible call the login without this custom code and check the logs?

Also it shows non fatal exception. Can you confirm that this is not crashing

Hi @RahulMarepalli, we would like to close this issue for now. Please feel free to reopen it with more information. Thanks