NativeScript / NativeScript/plugins
[@nativescript/google-signin] Google Sign In crashing after 8.5 migration
還沒有人認領這個 Issue。
- 主要語言
- TypeScript
- 星號
- 206
- 分支
- 123
- 平均合併
- 2 天 1 小時
- 30 天內合併 PR
- 1
描述
I have recently started migrating to NativeScript 8.5.0 and Angular 15.2.1. After the migration, some stuff broke, including the Google Signin plugin. Every time I try to Log in, this error appears:
An uncaught Exception occurred on "main" thread.
Calling js method onSuccess failed
Error: java.lang.NoSuchMethodError: no non-static method "Lorg/nativescript/plugins/googlesignin/GoogleSignIn$GoogleUser;.getUser()L;"
StackTrace:
onSuccess(file:///data/data/org.nativescript.demoapp/files/app/vendor.js:76427:52)
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1302)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1188)
at com.tns.Runtime.callJSMethod(Runtime.java:1175)
at com.tns.Runtime.callJSMethod(Runtime.java:1153)
at com.tns.Runtime.callJSMethod(Runtime.java:1149)
at com.tns.gen.org.nativescript.plugins.googlesignin.GoogleSignIn_Callback.onSuccess(GoogleSignIn_Callback.java:19)
at org.nativescript.plugins.googlesignin.GoogleSignIn$Companion.signInSilently$lambda-3$lambda-1(GoogleSignIn.kt:185)
at org.nativescript.plugins.googlesignin.GoogleSignIn$Companion.$r8$lambda$fH8L5lqFEywsPPnOtZDYuEPDXBs(Unknown Source:0)
at org.nativescript.plugins.googlesignin.GoogleSignIn$Companion$$ExternalSyntheticLambda12.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8280)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1073)
Caused by: java.lang.NoSuchMethodError: no non-static method "Lorg/nativescript/plugins/googlesignin/GoogleSignIn$GoogleUser;.getUser()L;"
... 18 more
The code I'm using to Log in has been unchanged for a long time and it's the following:
async googleLogin(): Promise<void> {
console.log("Signing in with google");
this.processing = true;
if (await GoogleSignin.playServicesAvailable()) {
try {
const googleUser: GoogleUser = await this.authService.googleSignin();
console.dir(googleUser);
}
}
}
Both of those console.log don't print anything atm, not sure why... I can't open devtools either.
Everything worked fine with the previous CLI version, Angular 14 and @nativescript/android@8.3.1
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,使用所描述的 NativeScript 8.5.0、Angular 15.2.1 和 @nativescript/android@8.3.1 設定重現崩潰。以 vendor.js 堆疊追蹤為參考,從 authService.googleSignin() 和 googleLogin() 入口點開始,追蹤 GoogleSignin 流程到 GoogleSignIn.kt 第 185 行附近。Google 登入在沒有出現所回報的 NoSuchMethodError 的情況下完成,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- android, angular, typescript
- 領域
- authentication, mobile
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100