on android Java, I am using firebase auth and UI - android

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)

Related

Fatal android 13: Exception: Unable to resume activity com.google.firebase.auth.internal.GenericIdpActivity: Firebase auth: null reference

I noticed one exception (Firebase Crashlytics) for Android 13 devices, no other devices, happened many times, only for one device till now.
I do not know why we getting NullPointerException we just use google sign in and firebase anonymous signin in our app.
What is com.google.firebase.auth.internal.GenericIdpActivity in firebase auth lib?
From Firebase Crashlytics:
Fatal Exception: java.lang.RuntimeException: Unable to resume activity {<my package name>t/com.google.firebase.auth.internal.GenericIdpActivity}: java.lang.NullPointerException: null reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5368)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5434)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8747)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by java.lang.NullPointerException: null reference
at com.google.android.gms.common.internal.Preconditions.checkNotNull(com.google.android.gms:play-services-basement##18.1.0:1)
at com.google.android.gms.internal.firebase-auth-api.zzxq.<init>(com.google.firebase:firebase-auth##21.0.6:5)
at com.google.firebase.auth.internal.GenericIdpActivity.onResume(com.google.firebase:firebase-auth##21.0.6:20)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1531)
at android.app.Activity.performResume(Activity.java:8734)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5341)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5434)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8747)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Android 13 crash: Getting securityException (calling identity is not authorized) crash on android 13

facebookincubator/Battery-Metrics repo's getSnapshot method in class SystemMetricsCollector is crashing because of java.lang.SecurityException: Calling identity is not authorized on android 13. It was working on android 12 and on versions before. Logs for the crash are:
java.lang.RuntimeException: Unable to start activity ComponentInfo{AppName/com.AppName.ux.activity.MainActivity}: java.lang.SecurityException: Calling identity is not authorized at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3686) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3823) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306) 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:7892) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.SecurityException: Calling identity is not authorized at android.os.Parcel.createExceptionOrNull(Parcel.java:3011) at android.os.Parcel.createException(Parcel.java:2995) at android.os.Parcel.readException(Parcel.java:2978) at android.os.Parcel.readException(Parcel.java:2920) at android.net.INetworkStatsService$Stub$Proxy.openSessionForUsageStats(INetworkStatsService.java:469) at android.app.usage.NetworkStats.<init>(NetworkStats.java:111) at android.app.usage.NetworkStatsManager.querySummary(NetworkStatsManager.java:424) at android.app.usage.NetworkStatsManager.querySummary(NetworkStatsManager.java:397) at com.facebook.battery.metrics.network.NetworkStatsManagerBytesCollector.getBytesForType(NetworkStatsManagerBytesCollector.java:51) at com.facebook.battery.metrics.network.NetworkStatsManagerBytesCollector.getTotalBytes(NetworkStatsManagerBytesCollector.java:38) at com.facebook.battery.metrics.network.NetworkMetricsCollector.getSnapshot(NetworkMetricsCollector.java:53) at com.facebook.battery.metrics.network.NetworkMetricsCollector.getSnapshot(NetworkMetricsCollector.java:33) at com.facebook.battery.metrics.composite.CompositeMetricsCollector.getSnapshot(CompositeMetricsCollector.java:99) at com.AppName.features.appsetup.ux.workflow.tasks.LaunchScreenTask.process(LaunchScreenTask.java:66) at com.AppName.features.appsetup.ux.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:84) at com.AppName.ux.activity.MainActivity.startWorkflow(MainActivity.java:414) at com.AppName.ux.activity.MainActivity.workflowDelegation(MainActivity.java:1134) at com.AppName.ux.activity.MainActivity.ecsEventHandler(MainActivity.java:568) at com.AppName.ux.activity.MainActivity.onCreate(MainActivity.java:324) at android.app.Activity.performCreate(Activity.java:8285) at android.app.Activity.performCreate(Activity.java:8264) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3667)

RuntimeException causes ANR on Android

I have a problem with my Android application. When I throw RuntimeException it causes ANR instead of crash.
For example, I have such code:
button.setOnClickListener {
throw RuntimeException("Test crash")
}
And when I click on this button aplication freezes for some time and then shows alert about ANR.
I have read similar question, otlined here: RuntimeException causes ANR instead of crash in android
But I can't figure out how to fix it. I checked everything I could: no UncaughtExceptionHandler-s attached, I do not use outdated google-play-services library. Where should I look for the cause of the problem?
Interesting thing that I can see stacktrace in logcat after I click this button:
2021-08-04 09:05:39.464 8764-8764/wa.testapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: wa.testapp, PID: 8764
java.lang.RuntimeException: Test crash
at com.example.testapp.ui.main.FragmentMain.onViewCreated$lambda-7(FragmentMain.kt:102)
at com.example.testapp.ui.main.FragmentMain.$r8$lambda$agRVJ2mByrrRLVPpioFH6VVBf9s(Unknown Source:0)
at com.example.testapp.ui.main.FragmentMain$$ExternalSyntheticLambda8.onClick(Unknown Source:0)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
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)
2021-08-04 09:05:39.467 8764-8764/wa.testapp E/a: Exception:
message: Test crash
localized message: Test crash
stack trace:
java.lang.RuntimeException: Test crash
at com.example.testapp.ui.main.FragmentMain.onViewCreated$lambda-7(FragmentMain.kt:102)
at com.example.testapp.ui.main.FragmentMain.$r8$lambda$agRVJ2mByrrRLVPpioFH6VVBf9s(Unknown Source:0)
at com.example.testapp.ui.main.FragmentMain$$ExternalSyntheticLambda8.onClick(Unknown Source:0)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
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)
I found a reason of such behaviour. The reason is a com.smartlook.recording:app:1.1.2-native dependency. After removing this library from project everything works fine.

I am getting error while login in google via firebase auth

I am using firebase authentication for sign in into app through google but when I clicked on sign in button list of account appear but after choosing an account nothing happens. in logs, I am getting API exception 7
Error Logs :
2019-08-01 16:48:30.591 5073-5073/rishab.listview.com.stepcounter W/google sign in failed: com.google.android.gms.common.api.ApiException: 7:
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:4)
at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source:8)
at rishab.listview.com.stepcounter.MainActivity.onActivityResult(MainActivity.java:184)
at android.app.Activity.dispatchActivityResult(Activity.java:7276)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4264)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4312)
at android.app.ActivityThread.-wrap19(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1644)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

com.firebase.ui.auth.FirebaseUiException: Error when saving credential

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

Categories

Resources