AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

Crash - dataIntent must not be null

Open AlgirdasVZ opened this issue 7 years ago • 1 comments

Hi!

Looks like some react-native-app-auth users are still facing this issue. I'm forwarding it here - it might be useful to find out whether this issue somehow could be solved on the react-native-app-auth library itself or only on AppAuth-Android where crash is triggered.

original issue thread: https://github.com/FormidableLabs/react-native-app-auth/issues/130

Crash scenario:

  1. Open the app
  2. Start authorizing - login page is displayed in browser
  3. Put the app in background
  4. Start the app again from the device launcher
  5. App user sees "Critical Error Occured!" with crashlogs

Fatal Exception: java.lang.RuntimeException Failure delivering result ResultInfo{who=null, request=0, result=0, data=null} to activity {<app's Main Activity>}: java.lang.NullPointerException: dataIntent must not be null ... net.openid.appauth.Preconditions.checkNotNull + 55 (Preconditions.java:55) net.openid.appauth.AuthorizationResponse.fromIntent + 564 (AuthorizationResponse.java:564) com.rnappauth.RNAppAuthModule.onActivityResult + 303 (RNAppAuthModule.java:303)

Crash is avoided if on step 4 the app is resumed instead of relaunched.

Note: in this case, AndroidManifest.xml contains android:launchMode="singleTask"

AlgirdasVZ avatar Jul 02 '19 11:07 AlgirdasVZ

Is this fixed??

tarun29061990 avatar Feb 04 '20 13:02 tarun29061990