-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Requires IMMUTABLE tag crash on API 31 #1999
Comments
Didn't find any proper solution but solved this issue by adding this latest Work Manager Dependency. |
I am facing the same issue. As suggested by @farooqahmadm1 and some other solutions I read online, I added the work manager dependency using: That didn't solve the problem for me. The crash occurs right after the auth method returns to the app. Here is the full stack trace:
I do notice that the exception occurs somewhere in the Facebook Login Manager, so maybe this fix has to be done on the Facebook SDK side. |
Just fixed this by updating to the latest Facebook SDK: There is no need to add the work manager dependency. |
This is still happening with the firebase email sign-in, is there a proper workaround? |
firebase-auth need to be updated to latest version |
The email stacktrace:
I can't think of any workaround here except for dropping your targetSdkVersion and waiting for a fix. |
I believe this library could be fixed by taking the PendingIntent from CredentialsClient and giving it the flags update current and immutable or'd together Sort of like so (although this is kotlin) https://github.com/square/leakcanary/pull/2124/files#diff-3165c16e2b07bd1a48c821c2f692a640543f57e5172dc5e9029636120712ec97R182-R185 here FirebaseUI-Android/auth/src/main/java/com/firebase/ui/auth/ui/phone/CheckPhoneHandler.java Lines 28 to 29 in 980d0cc
|
Nothing seems to be fixing this issue so eventually it was just less painless to write my own auth ui login system.. |
FYI, I could open activity with default email address to avoid creating PendingIntent
|
Does anybody found a fix for this? I'm still facing this issue even with androidx.work:work-runtime-ktx:2.7.1 on api 31 with only phone number provider. |
Looks like someone needs to make a PR sorta like #1999 (comment) @Surendar7 |
updating dependencies (firebase-bom -> 29.0.3, play-services-auth -> 20.0.0, play:core -> 1.10.2) solved the problem for me |
Basically two options:
|
Closing this. See UweTrottmann's comment for the general solution. |
@thatfiredev How is that a solution? That's just a work-around. Your library should work out of the box, without needing to update any of its dependencies manually. |
This should be fixed in version 8.0.2 of FirebaseUI for Android |
I was facing this crash, so I updated the related dependencies:
Now I'm facing another crash:
@thatfiredev What's missing? |
@zjamshidi your very error message gives you the clue to get you on the path. New Facebook SDKs have breaking changes in initialization sequence. You must adapt to them. Has nothing to do with this module + this issue |
Thanks, @mikehardy. I found the issue. The developers of this module need to update their documentation |
Step 2: Describe your environment
Step 3: Describe the problem:
Steps to reproduce:
Clicking on button to open Auth activity crashes app
Observed Results:
Process: hr.pavetic.simplify.debug, PID: 8005
java.lang.IllegalArgumentException: hr.pavetic.simplify.debug: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
at android.app.PendingIntent.getActivity(PendingIntent.java:444)
at android.app.PendingIntent.getActivity(PendingIntent.java:408)
at com.google.android.gms.internal.auth-api.zzr.zzc(com.google.android.gms:play-services-auth@@19.0.0:19)
at com.google.android.gms.auth.api.credentials.CredentialsClient.getHintPickerIntent(com.google.android.gms:play-services-auth@@19.0.0:10)
at com.firebase.ui.auth.ui.phone.CheckPhoneHandler.fetchCredential(CheckPhoneHandler.java:28)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.setDefaultCountryForSpinner(CheckPhoneNumberFragment.java:238)
at com.firebase.ui.auth.ui.phone.CheckPhoneNumberFragment.onActivityCreated(CheckPhoneNumberFragment.java:127)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2994)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:559)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:262)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1797)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1715)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1658)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2780)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2715)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:262)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:478)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
at android.app.Activity.performStart(Activity.java:8076)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3653)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2203)
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:7822)
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:1003)
Expected Results:
Relevant Code:
I was opening activity with ActivityResultLauncher, but after this error tried different approach with PendingIntent but still crashes.
`final Intent phoneAuthIntent =
AuthUI.getInstance()
.createSignInIntentBuilder()
.setAvailableProviders(providers)
.setLogo(R.drawable.simplify_logo)
.setTheme(R.style.FirebaseAuthTheme)
.setTosAndPrivacyPolicyUrls(
getResources().getString(R.string.terms_and_conditions_url),
getResources().getString(R.string.privacy_url))
.setIsSmartLockEnabled(!BuildConfig.DEBUG /* credentials /, true / hints */)
.build();
The text was updated successfully, but these errors were encountered: