I have created a Flutter application that uses amplify_auth_cognito and amplify_core packages for authentication.
In debug mode, the app works fine without any issues. The iOS version works fine as well, even when installed from the TestFlight.
However, when I run in release mode created apk on a physical Android device, whenever I click on a button that calls Amplify.Auth.signIn(username, password) function, the whole app crashes.
App crash log says:
time: 1604934616377
msg: java.lang.NoSuchFieldException: SUCCESS
stacktrace: java.lang.AssertionError: java.lang.NoSuchFieldException: SUCCESS
at c.b.b.w.n.n$j0.<init>(Unknown Source:87)
at c.b.b.w.n.n$w.a(Unknown Source:29)
at c.b.b.e.a(Unknown Source:74)
at c.b.b.w.n.i.a(Unknown Source:42)
at c.b.b.w.n.i.a(Unknown Source:123)
at c.b.b.w.n.i.a(Unknown Source:22)
at c.b.b.e.a(Unknown Source:74)
at c.b.b.e.a(Unknown Source:4)
at c.b.b.e.a(Unknown Source:8)
at c.b.b.e.a(Unknown Source:5)
at c.b.b.e.a(Unknown Source:13)
at com.amazonaws.amplify.amplify_auth_cognito.types.FlutterFetchCognitoAuthSessionResult.a(Unknown Source:4)
at com.amazonaws.amplify.amplify_auth_cognito.types.FlutterFetchCognitoAuthSessionResult.a(Unknown Source:42)
at com.amazonaws.amplify.amplify_auth_cognito.AuthCognito$prepareCognitoSessionResult$1.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7398)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)
Caused by: java.lang.NoSuchFieldException: SUCCESS
at java.lang.Class.getField(Class.java:1604)
at c.b.b.w.n.n$j0.<init>(Unknown Source:34)
... 20 more
Any idea why is this happening and how to fix it?
Related
I have a react native app that has firebase modules such as
"#react-native-firebase/app": "^14",
"#react-native-firebase/messaging": "^14",
App is working fine with debugging mode, Apk is also fine, but when I publish it to google play internal testing, App is crashing after installing it with below error! There is no issue with app ids and json file. I have already double checked it.
FATAL EXCEPTION: mqt_native_modules
Process: com.app, PID: 26684
java.lang.IllegalStateException: FirebaseApp with name XXXXXXXXXXXXX doesn't exist. Available app names: [DEFAULT]
at com.google.firebase.FirebaseApp.getInstance(Unknown Source:83)
at io.invertase.firebase.messaging.ReactNativeFirebaseMessagingModule.getToken(Unknown Source:0)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:148)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:21)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37)
at java.lang.Thread.run(Thread.java:1012)
2023-01-15 01:35:51.642 1629-2656 ActivityManager
pid-1629
I was working fine for the last 1 year, but now if I logging with an id that is logged in on some other device then it gives me the following error
A sign-in error occurred.
com.firebase.ui.auth.FirebaseUiException: Error when saving credential.
at com.firebase.ui.auth.viewmodel.smartlock.SmartLockHandler.lambda$saveCredentials$0$SmartLockHandler(SmartLockHandler.java:97)
at com.firebase.ui.auth.viewmodel.smartlock.-$$Lambda$SmartLockHandler$pN6hZnWoFDaT_06xqjJRcsW8NkU.onComplete(Unknown Source:2)
at com.google.android.gms.tasks.zzj.run(com.google.android.gms:play-services-tasks##17.2.0:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: com.google.android.gms.common.api.ApiException: 16: Cannot find an eligible account.
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(com.google.android.gms:play-services-base##17.5.0:4)
at com.google.android.gms.common.internal.zap.zaa(com.google.android.gms:play-services-base##17.5.0:2)
at com.google.android.gms.common.internal.zar.onComplete(com.google.android.gms:play-services-base##17.5.0:6)
at com.google.android.gms.common.api.internal.BasePendingResult.zab(com.google.android.gms:play-services-base##17.5.0:177)
at com.google.android.gms.common.api.internal.BasePendingResult.setResult(com.google.android.gms:play-services-base##17.5.0:136)
at com.google.android.gms.internal.auth-api.zzo.setResult(com.google.android.gms:play-services-auth##19.0.0:6)
at com.google.android.gms.internal.auth-api.zzp.zzd(com.google.android.gms:play-services-auth##19.0.0:4)
at com.google.android.gms.internal.auth-api.zzu.zzc(com.google.android.gms:play-services-auth##19.0.0:9)
at com.google.android.gms.internal.auth-api.zzc.onTransact(com.google.android.gms:play-services-auth##19.0.0:13)
at android.os.Binder.execTransactInternal(Binder.java:1154)
at android.os.Binder.execTransact(Binder.java:1123)
I am facing issue with the Signed APK, debug apk works perfectly, When I generate signed apk and run it show error.
below is error log
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.woodenstreet, PID: 25818
java.lang.NoSuchMethodError: No virtual method x(Ljava/lang/String;I)I in class Lorg/json/JSONObject; or its super classes (declaration of 'org.json.JSONObject' appears in /apex/com.android.runtime/javalib/core-libart.jar)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.d(SourceFile:1)
at com.google.firebase.crashlytics.internal.settings.DefaultSettingsJsonTransform.e(SourceFile:2)
at com.google.firebase.crashlytics.internal.settings.SettingsController.(SourceFile:11)
at com.google.firebase.crashlytics.internal.settings.SettingsController.l(SourceFile:14)
at com.google.firebase.crashlytics.internal.Onboarding.l(SourceFile:4)
at com.google.firebase.crashlytics.FirebaseCrashlytics.a(SourceFile:26)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.b(SourceFile:5)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.a(Unknown Source:0)
at com.google.firebase.crashlytics.CrashlyticsRegistrar$$Lambda$1.a(Unknown Source:2)
at com.google.firebase.components.ComponentRuntime.f(SourceFile:1)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(Unknown Source:4)
at com.google.firebase.components.Lazy.get(SourceFile:6)
at com.google.firebase.components.ComponentRuntime.e(SourceFile:5)
at com.google.firebase.FirebaseApp.n(SourceFile:7)
at com.google.firebase.FirebaseApp.q(SourceFile:13)
at com.google.firebase.FirebaseApp.p(SourceFile:1)
at com.google.firebase.FirebaseApp.o(SourceFile:7)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(SourceFile:1)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2092)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2066)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(SourceFile:2)
at android.app.ActivityThread.installProvider(ActivityThread.java:6983)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Here build.gradle app level file
Build file
I am not able to figure out the error please help me.
Thanks
Your release configuration in build.gradle is not correct for your libraries. I think it have to do with json, and proguard obfuscates some methods of it.
try this https://stackoverflow.com/a/61481954/10117882
This error occurs when signing in to my app using Firebase.ui.auth and google sign-in, unable to get data from firestore too because of the error.
2019-06-22 22:16:57.237 6793-6793/meter.meterE/AuthUI: A sign-in error occurred.
com.firebase.ui.auth.FirebaseUiException: Error when saving credential.
at com.firebase.ui.auth.viewmodel.smartlock.SmartLockHandler$1.onComplete(SmartLockHandler.java:98)
at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.google.android.gms.common.api.ApiException: 6: Passphrase required.
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:4)
at com.google.android.gms.common.internal.zai.zaf(Unknown Source:2)
at com.google.android.gms.common.internal.zaj.onComplete(Unknown Source:6)
at com.google.android.gms.common.api.internal.BasePendingResult.zaa(Unknown Source:172)
at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source:131)
at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.setResult(Unknown Source:36)
at com.google.android.gms.internal.auth-api.zzo.zzc(Unknown Source:4)
at com.google.android.gms.internal.auth-api.zzv.dispatchTransaction(Unknown Source:9)
at com.google.android.gms.internal.auth-api.zzd.onTransact(Unknown Source:12)
at android.os.Binder.execTransact(Binder.java:731)
This happens when your passwords on Google account are protected with a passphrase. I think this should be a ResolvableApiException, but they did not put an effort into coding resolution handling for the situation. So you have to live with the fact that users with passphrases will not be able to benefit from Smart Lock. For testing, you can reset your passphrase. See instructions: https://support.google.com/chrome/answer/165139
I was following this tutorial.
It should go to HomeActivity but it's not: it shows MainActivity instead.
I am new to coding and don't know what to do.
I already added SHA-1 to Firebase.
E/AuthUI: A sign-in error occurred.
com.firebase.ui.auth.FirebaseUiException: Error when saving credential.
at com.firebase.ui.auth.viewmodel.smartlock.SmartLockHandler$1.onComplete(SmartLockHandler.java:98)
at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: com.google.android.gms.common.api.ApiException: 16: No eligible accounts can be found.
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:4)
at com.google.android.gms.common.internal.zai.zaf(Unknown Source:2)
at com.google.android.gms.common.internal.zaj.onComplete(Unknown Source:6)
at com.google.android.gms.common.api.internal.BasePendingResult.zaa(Unknown Source:172)
at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source:131)
at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.setResult(Unknown Source:36)
at com.google.android.gms.internal.auth-api.zzo.zzc(Unknown Source:4)
at com.google.android.gms.internal.auth-api.zzv.dispatchTransaction(Unknown Source:9)
at com.google.android.gms.internal.auth-api.zzd.onTransact(Unknown Source:12)
at android.os.Binder.execTransact(Binder.java:731)