Flutter Google Sign-In Fails in Release Mode with PlatformException(sign_in_failed, D0.b: 10: , null, null)

51 views Asked by At

I'm developing a Flutter application with Google Sign-In functionality. The sign-in works perfectly in debug mode, but when I run my app in release mode (flutter run --release) or after building the APK, Google Sign-In fails with the following error: PlatformException(sign_in_failed, D0.b: 10: , null, null).

Here's what I've done so far to troubleshoot and attempt to resolve the issue:

  • SHA-1 and SHA-256 Keys: I've added both SHA-1 and SHA-256 keys for my debug and release keystores to my Firebase project settings.
  • Firebase Configuration: I've downloaded the latest google-services.json from Firebase and placed it in the android/app directory of my project.
  • OAuth Client IDs: Verified that the OAuth client IDs in the Firebase console match those in the Google Cloud Platform console for my project.
  • Permissions and API Key: My AndroidManifest.xml includes Internet permission.
  • Google Sign-In Configuration: I'm using the google_sign_in Flutter plugin for authentication, without specifying any custom client IDs in my Flutter code.
  • Flutter Clean and Rebuild: I've run flutter clean followed by flutter pub get and rebuilt my APK.

Despite these steps, the error persists only in release mode. Here's my flutter doctor -v output for reference:

[√] Flutter (Channel stable, 3.19.2, on Microsoft Windows [version 10.0.19045.4123], locale fr-FR)
• Flutter version 3.19.2 on channel stable at F:\src\flutter\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7482962148 (10 days ago), 2024-02-27 16:51:22 -0500
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1

[√] 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 C:\Users\royth\AppData\Local\Android\sdk
• 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.9+0--11185874)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
  Download at https://visualstudio.microsoft.com/downloads/.
  Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.2)
• 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.9+0--11185874)

[√] IntelliJ IDEA Ultimate Edition (version 2023.3)
• IntelliJ at F:\Program Files\JetBrains\IntelliJ IDEA 2023.3.4
• Flutter plugin version 78.1.1
• Dart plugin version 233.13763.5

[√] Connected device (4 available)
• Pixel 7 (mobile)  • adb-28101FDH2000Q6-Gy1HTM._adb-tls-connect._tcp • android-arm64  • Android 14 (API 34)
• Windows (desktop) • windows                                         • windows-x64    • Microsoft Windows [version 10.0.19045.4123]
• Chrome (web)      • chrome                                          • web-javascript • Google Chrome 122.0.6261.112
• Edge (web)        • edge                                            • web-javascript • Microsoft Edge 122.0.2365.66

[√] Network resources
• All expected network resources are available.

I suspect the issue might be related to the OAuth configuration or the SHA-1/SHA-256 key setup, but I'm unsure how to proceed. Has anyone faced a similar issue or can offer insight into what might be going wrong?

Any help or suggestions would be greatly appreciated!

0

There are 0 answers