Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android crash with NullPointerException #55

Closed
masimplo opened this issue Oct 4, 2019 · 2 comments · Fixed by #85
Closed

Android crash with NullPointerException #55

masimplo opened this issue Oct 4, 2019 · 2 comments · Fixed by #85
Labels
android bug Something isn't working
Milestone

Comments

@masimplo
Copy link

masimplo commented Oct 4, 2019

In google console I see a handful of crashes with the following stacktrace attached

Caused by: java.lang.NullPointerException: 
 
  at com.byteowls.capacitor.oauth2.OAuth2ClientPlugin.handleOnActivityResult (OAuth2ClientPlugin.java:224)
  at com.getcapacitor.Bridge.onActivityResult (Bridge.java:748)
  at com.getcapacitor.BridgeActivity.onActivityResult (BridgeActivity.java:209)
  at android.app.Activity.dispatchActivityResult (Activity.java:7634)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:4622)

Any idea what might be causing this?

Using version 1.0.1 with the following invocation:

return from(Plugins.OAuth2Client.authenticate(
      {
        appId: this._appConfig.thirdPartyAPIs.googleOAuth.clientId.web,
        authorizationBaseUrl: 'https://accounts.google.com/o/oauth2/auth',
        accessTokenEndpoint: 'https://www.googleapis.com/oauth2/v4/token',
        scope: 'email profile',
        resourceUrl: 'https://www.googleapis.com/userinfo/v2/me',
        web: {
          redirectUrl: 'http://localhost:4200',
          windowOptions: 'height=600,left=0,top=0'
        },
        android: {
          appId: this._appConfig.thirdPartyAPIs.googleOAuth.clientId.android,
          responseType: 'code', 
          customScheme: 'com.myapp.android:/'
        },
        ios: {
          appId: this._appConfig.thirdPartyAPIs.googleOAuth.clientId.ios,
          responseType: 'code', 
          customScheme: 'com.myapp.myapp:/'
        }
      }
    )
@moberwasserlechner
Copy link
Collaborator

Hi,

the config you use is the same I have, so I have no idea why this breaks for you.

Could you plz share some version information

  • Capacitor
  • Android (API Level)
  • Device Model

thx

@moberwasserlechner moberwasserlechner added android bug Something isn't working labels Oct 19, 2019
@masimplo
Copy link
Author

Hi,

thanks for looking into this.
Capacitor 1.2.1

Devices:

HUAWEI Y5 2018 (HWDRA-MG) | 11 | 64.7%
CPH1853 (CPH1853) | 2 | 11.8%
HUAWEI Y5 Prime 2018 (HWDRA-M) | 1 | 5.9%
A3s (CPH1803) | 1 | 5.9%
Z61 (Z61) | 1 | 5.9%
Redmi 6A (cactus) | 1 | 5.9%

All running Android 8.1 (API Level 27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants