flutter_smart_auth
flutter_smart_auth copied to clipboard
Incompatibility with play-services-auth 21.0.0 and google_sign_in_android 6.1.22
Describe the bug I can't compile my (android) app in release mode after upgrading google_sign_in_android to 6.1.22. I get errors (10+) like:
[ +1 ms] Missing class com.google.android.gms.auth.api.credentials.CredentialPickerConfig$Builder (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.requestHint(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
To Reproduce Steps to reproduce the behavior:
- Have both smart_auth and google_sign_in_android latest versions in a flutter project with android
- flutter build apk --release --verbose
Screenshots N/A
smart_auth version: 2.0.0
Result of: flutter doctor --verbose
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at [reducted] • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314) • All Android licenses accepted.
[√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.0) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.7.34003.232 • Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2023.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
[√] VS Code (version 1.87.2) • VS Code at [reducted] • Flutter extension version 3.84.0
[√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22621.3296] • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.59 • Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.133
[√] Network resources • All expected network resources are available.
• No issues found!
Smartphone (please complete the following information):
- Device: Android Emulator
- OS: Android API 33
Additional context
So, going through the release notes, google_sign_in_android says they upgraded play-services-auth to 21.0.0 (url)
The release notes of play-services-auth say that there is a major breaking change: they removed Credentials API! (https://developers.google.com/android/guides/releases#february_15_2024)
The settings.gradle of this plugin I see it depends on play-services-auth 20.7.0 (https://github.com/Tkko/flutter_smart_auth/blob/be97b1bcfb3169d90ab5792393afea574d964630/android/build.gradle#L56)
I guess 21 is preferred over 20.7 during compilation, so no wonder why those classes mentioned in the error log can not be found.
This is why I think this is worthy of a bug report for smart_auth: can you please support the new Credential Manager API?
Did you implemented the Credential Manager API?
Hi @Tkko @gourgouris i am ready to take up this issue but before starting i want some more info about that with the latest version we get something known as GetPhoneNumberHintIntentRequest.builder() which is completely different from the previous versions, whats you take on this ? Like i want to know your views on this
Edit i am taking about this version implementation 'com.google.android.gms:play-services-auth:21.2.0'
Same issue:
R8 Missing Classes Error in Release Build: Google Play Services Credentials API
Flutter Version
Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2663184aa7 (6 days ago) • 2024-09-11 16:27:48 -0500
Engine • revision 36335019a8
Tools • Dart 3.5.3 • DevTools 2.37.3
Error Log
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in build/app/outputs/mapping/release/missing_rules.txt.
Missing class com.google.android.gms.auth.api.credentials.Credential$Builder (referenced from: com.google.android.gms.auth.api.credentials.Credential fman.ge.smart_auth.SmartAuthPlugin.maybeBuildCredential(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.Credential (referenced from: com.google.android.gms.auth.api.credentials.Credential fman.ge.smart_auth.SmartAuthPlugin$onGetCredentialRequest$1.$credential and 13 other contexts)
Missing class com.google.android.gms.auth.api.credentials.CredentialPickerConfig$Builder (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.requestHint(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.CredentialPickerConfig (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.requestHint(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.CredentialRequest$Builder (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.getCredential(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.CredentialRequest (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.getCredential(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.Credentials (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.deleteCredential(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
Missing class com.google.android.gms.auth.api.credentials.CredentialsClient (referenced from: void fman.ge.smart_auth.SmartAuthPlugin.deleteCredential(io.flutter.plugin.common.MethodCall, io.flutter.plugin.common.MethodChannel$Result))
In version 3.0.0 com.google.android.gms:play-services-auth: was upgraded to 21.3.0.
Additionally, I removed the com.google.android.gms:play-services-auth-api-phone:18.0.1 and added new credentials manager.
So, this should not be a problem anymore, feel free to open the issue if it isn't solved in new update.