Flutterfire: [cloud_firestore,firebase_auth] Gradle error on adding firebase to any flutter app

Created on 25 Nov 2019  Â·  6Comments  Â·  Source: FirebaseExtended/flutterfire

Describe the bug
Getting the following error on every version of plugins released since May 7, 2019.
cloud_firestore: ^0.11.0 and onwards
firebase_auth: ^0.10.0 and onwards
The changelog for these versions: Update Android dependencies to latest.
I haven't checked other flutterfire plugins, but they might have the same error.

AGPBI: {"kind":"error","text":"Type com.google.android.gms.common.internal.zzf is referenced as an interface from `com.google.android.gms.internal.zzcfb`.","sources":[{}],"tool":"D8"}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform artifact 'firebase-analytics-impl.aar (com.google.firebase:firebase-analytics-impl:11.4.2)' to match attributes {artifactType=android-dex, dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=21}.
      > Execution failed for DexingWithClasspathTransform: C:\Users\Shivam\.gradle\caches\transforms-2\files-2.1\a2d4051f99ffbe9ad8884d8a69091e22\jetified-firebase-analytics-impl-11.4.2\jars\classes.jar.
         > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 11sGradle task assembleDebug failed with exit code 1
Exited (sigterm)

To Reproduce
Steps to reproduce the behavior:

  1. Create a new flutter app
  2. Create and add firebase project to the app (https://codelabs.developers.google.com/codelabs/flutter-firebase)
  3. Add plugins with versions dated May 7, 2019 and onwards.
  4. Run the app on physical android device. (no error in flutter web)

Expected behavior
App should run in debug mode.

Additional context

Target Platform: Android
Target OS version/browser: Android P
Devices: Physical device - Nokia 6.1 plus

Error occurs on both latest dev and master branch.


Logs

PS D:\Shivam\Code\Flutter\new_app> flutter run --verbose
[  +20 ms] executing: [C:\Programming\flutter\] git -c log.showSignature=false log -n 1
--pretty=format:%H
[  +52 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] b6e92003c8abc5e04a193b58e4a7c8b98d4b8536
[        ] executing: [C:\Programming\flutter\] git describe --match v*.*.* --first-parent --long
--tags
[  +36 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.10-0-gb6e92003c
[   +6 ms] executing: [C:\Programming\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +33 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [C:\Programming\flutter\] git ls-remote --get-url origin
[  +31 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +92 ms] executing: [C:\Programming\flutter\] git rev-parse --abbrev-ref HEAD
[  +36 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[  +85 ms] executing: C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[  +18 ms] Exit code 0 from: C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe
devices -l
[        ] List of devices attached
           192.168.43.44:5555     device product:Dragon_00WW model:Nokia_6_1_Plus device:DRG_sprout 
           transport_id:1
[  +16 ms] C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe -s 192.168.43.44:5555
shell getprop
[ +249 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +10 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +6 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +5 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.        
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.        
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.       
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.       
[  +35 ms] Found plugin cloud_firestore at
C:\Programming\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.10+2\
[  +12 ms] Found plugin firebase_core at
C:\Programming\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.2\
[ +603 ms] Found plugin cloud_firestore at
C:\Programming\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.10+2\
[   +6 ms] Found plugin firebase_core at
C:\Programming\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.2\
[  +60 ms] Generating
D:\Shivam\Code\Flutter\new_app\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +28 ms] ro.hardware = qcom
[  +47 ms] Launching lib\main.dart on Nokia 6 1 Plus in debug mode...
[  +10 ms] executing: C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe -s
192.168.43.44:5555 shell -x logcat -v time -s flutter
[  +13 ms] executing: C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe version
[  +27 ms] Android Debug Bridge version 1.0.41
           Version 29.0.5-5949299
           Installed as C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +2 ms] executing: C:\Users\Shivam\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +22 ms] Building APK
[  +22 ms] Running Gradle task 'assembleDebug'...
[   +4 ms] gradle.properties already sets `android.enableR8`
[   +3 ms] Using gradle from D:\Shivam\Code\Flutter\new_app\android\gradlew.bat.
[   +6 ms] executing: C:\Programming\Android Studio\jre\bin\java -version
[  +77 ms] Exit code 0 from: C:\Programming\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_202-release"
           OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
           OpenJDK 64-Bit Server VM (build 25.202-b03, mixed mode)
[   +2 ms] executing: [D:\Shivam\Code\Flutter\new_app\android\]
D:\Shivam\Code\Flutter\new_app\android\gradlew.bat -Pverbose=true
-Ptarget=D:\Shivam\Code\Flutter\new_app\lib\main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-arm64 assembleDebug
[+1327 ms] > Configure project :app
[        ] google-services plugin could not detect any version for com.google.android.gms or
com.google.firebase, default version: 11.4.2 will be used.
[  +15 ms] please apply google-services plugin at the bottom of the build file.
[   +1 ms] Could not find google-services.json while looking in [src/nullnull/debug,
src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
[  +54 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[   +4 ms] Could not find google-services.json while looking in [src/nullnull/release,
src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
[  +20 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[  +20 ms] Could not find google-services.json while looking in [src/nullnull/profile,
src/profile/nullnull, src/nullnull, src/profile, src/nullnullProfile]
[  +16 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[ +368 ms] > Task :app:compileFlutterBuildDebug UP-TO-DATE
[   +2 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[  +16 ms] > Task :app:preBuild UP-TO-DATE
[   +8 ms] > Task :app:preDebugBuild UP-TO-DATE
[        ] > Task :cloud_firestore:preBuild UP-TO-DATE
[        ] > Task :cloud_firestore:preDebugBuild UP-TO-DATE
[        ] > Task :firebase_core:preBuild UP-TO-DATE
[        ] > Task :firebase_core:preDebugBuild UP-TO-DATE
[  +56 ms] > Task :cloud_firestore:packageDebugRenderscript NO-SOURCE
[        ] > Task :firebase_core:packageDebugRenderscript NO-SOURCE
[        ] > Task :app:compileDebugRenderscript NO-SOURCE
[        ] > Task :firebase_core:compileDebugAidl NO-SOURCE
[        ] > Task :cloud_firestore:compileDebugAidl NO-SOURCE
[   +1 ms] > Task :app:compileDebugAidl NO-SOURCE
[        ] > Task :app:checkDebugManifest UP-TO-DATE
[        ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :app:cleanMergeDebugAssets
[        ] > Task :app:mergeDebugShaders UP-TO-DATE
[        ] > Task :app:compileDebugShaders UP-TO-DATE
[   +1 ms] > Task :app:generateDebugAssets UP-TO-DATE
[        ] > Task :cloud_firestore:mergeDebugShaders UP-TO-DATE
[        ] > Task :cloud_firestore:compileDebugShaders UP-TO-DATE
[        ] > Task :cloud_firestore:generateDebugAssets UP-TO-DATE
[        ] > Task :cloud_firestore:packageDebugAssets UP-TO-DATE
[   +2 ms] > Task :firebase_core:mergeDebugShaders UP-TO-DATE
[        ] > Task :firebase_core:compileDebugShaders UP-TO-DATE
[   +8 ms] > Task :firebase_core:generateDebugAssets UP-TO-DATE
[   +1 ms] > Task :firebase_core:packageDebugAssets UP-TO-DATE
[  +76 ms] > Task :app:mergeDebugAssets
[ +198 ms] > Task :app:copyFlutterAssetsDebug
[        ] > Task :app:mainApkListPersistenceDebug UP-TO-DATE
[        ] > Task :app:generateDebugResValues UP-TO-DATE
[   +2 ms] > Task :app:generateDebugResources UP-TO-DATE
[   +5 ms] > Task :app:processDebugGoogleServices
[   +1 ms] Parsing json file: D:\Shivam\Code\Flutter\new_app\android\app\google-services.json       
[        ] > Task :cloud_firestore:generateDebugResValues UP-TO-DATE
[        ] > Task :cloud_firestore:compileDebugRenderscript NO-SOURCE
[        ] > Task :cloud_firestore:generateDebugResources UP-TO-DATE
[        ] > Task :cloud_firestore:packageDebugResources UP-TO-DATE
[   +1 ms] > Task :firebase_core:generateDebugResValues UP-TO-DATE
[  +36 ms] > Task :firebase_core:compileDebugRenderscript NO-SOURCE
[  +61 ms] > Task :firebase_core:generateDebugResources UP-TO-DATE
[   +5 ms] > Task :firebase_core:packageDebugResources UP-TO-DATE
[   +1 ms] > Task :app:mergeDebugResources UP-TO-DATE
[   +3 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[        ] > Task :cloud_firestore:checkDebugManifest UP-TO-DATE
[  +29 ms] > Task :cloud_firestore:processDebugManifest UP-TO-DATE
[   +1 ms] > Task :firebase_core:checkDebugManifest UP-TO-DATE
[        ] > Task :firebase_core:processDebugManifest UP-TO-DATE
[        ] > Task :app:processDebugManifest UP-TO-DATE
[        ] > Task :cloud_firestore:parseDebugLibraryResources UP-TO-DATE
[        ] > Task :firebase_core:parseDebugLibraryResources UP-TO-DATE
[  +34 ms] > Task :firebase_core:generateDebugRFile UP-TO-DATE
[  +14 ms] > Task :cloud_firestore:generateDebugRFile UP-TO-DATE
[   +1 ms] > Task :app:processDebugResources UP-TO-DATE
[        ] > Task :cloud_firestore:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :firebase_core:generateDebugBuildConfig UP-TO-DATE
[        ] > Task :firebase_core:javaPreCompileDebug UP-TO-DATE
[        ] > Task :firebase_core:compileDebugJavaWithJavac UP-TO-DATE
[  +89 ms] > Task :firebase_core:bundleLibCompileDebug UP-TO-DATE
[        ] > Task :cloud_firestore:javaPreCompileDebug UP-TO-DATE
[        ] > Task :cloud_firestore:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :cloud_firestore:bundleLibCompileDebug UP-TO-DATE
[   +7 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[        ] > Task :app:javaPreCompileDebug UP-TO-DATE
[        ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[        ] > Task :app:compileDebugSources UP-TO-DATE
[        ] > Task :app:processDebugJavaRes NO-SOURCE
[        ] > Task :cloud_firestore:processDebugJavaRes NO-SOURCE
[        ] > Task :cloud_firestore:bundleLibResDebug UP-TO-DATE
[        ] > Task :firebase_core:processDebugJavaRes NO-SOURCE
[        ] > Task :firebase_core:bundleLibResDebug UP-TO-DATE
[ +112 ms] > Task :app:mergeDebugJavaResource UP-TO-DATE
[  +77 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[   +1 ms] > Task :firebase_core:bundleLibRuntimeDebug UP-TO-DATE
[   +3 ms] > Task :firebase_core:createFullJarDebug UP-TO-DATE
[        ] > Task :cloud_firestore:bundleLibRuntimeDebug UP-TO-DATE
[   +1 ms] > Task :cloud_firestore:createFullJarDebug UP-TO-DATE
[        ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[        ] > Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
[  +94 ms] > Task :app:mergeProjectDexDebug UP-TO-DATE
[  +11 ms] > Task :app:mergeLibDexDebug UP-TO-DATE
[        ] > Task :app:validateSigningDebug UP-TO-DATE
[        ] > Task :app:signingConfigWriterDebug UP-TO-DATE
[        ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :cloud_firestore:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :cloud_firestore:mergeDebugNativeLibs UP-TO-DATE
[   +1 ms] > Task :cloud_firestore:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task :cloud_firestore:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE    
[        ] > Task :firebase_core:mergeDebugJniLibFolders UP-TO-DATE
[        ] > Task :firebase_core:mergeDebugNativeLibs UP-TO-DATE
[        ] > Task :firebase_core:stripDebugDebugSymbols UP-TO-DATE
[        ] > Task :firebase_core:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
[        ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[  +89 ms] Unable to strip library
'D:\Shivam\Code\Flutter\new_app\build\app\intermediates\merged_native_libs\debug\out\lib\x86\libflutter.so' due to missing strip tool for ABI 'X86'. Packaging it as is.
[ +388 ms] > Task :app:stripDebugDebugSymbols
[   +2 ms] Compatible side by side NDK version was not found.
[   +7 ms] Unable to strip library
'D:\Shivam\Code\Flutter\new_app\build\app\intermediates\merged_native_libs\debug\out\lib\arm64-v8a\libflutter.so' due to missing strip tool for ABI 'ARM64_V8A'. Packaging it as is.
[   +1 ms] Unable to strip library
'D:\Shivam\Code\Flutter\new_app\build\app\intermediates\merged_native_libs\debug\out\lib\x86_64\libflutter.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
[   +1 ms] > Task :cloud_firestore:extractDebugAnnotations UP-TO-DATE
[   +7 ms] > Task :cloud_firestore:mergeDebugGeneratedProguardFiles UP-TO-DATE
[        ] > Task :cloud_firestore:mergeDebugConsumerProguardFiles UP-TO-DATE
[        ] > Task :cloud_firestore:prepareLintJarForPublish UP-TO-DATE
[        ] > Task :cloud_firestore:mergeDebugJavaResource UP-TO-DATE
[        ] > Task :cloud_firestore:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE   
[        ] > Task :cloud_firestore:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
[        ] > Task :cloud_firestore:bundleDebugAar
[        ] > Task :cloud_firestore:compileDebugSources UP-TO-DATE
[   +1 ms] AGPBI: {"kind":"error","text":"Type com.google.android.gms.common.internal.zzf is        
referenced as an interface from
`com.google.android.gms.internal.zzcfb`.","sources":[{}],"tool":"D8"}
[   +2 ms] > Task :cloud_firestore:assembleDebug
[        ] > Task :firebase_core:extractDebugAnnotations UP-TO-DATE
[   +1 ms] > Task :firebase_core:mergeDebugGeneratedProguardFiles UP-TO-DATE
[   +3 ms] > Task :firebase_core:mergeDebugConsumerProguardFiles UP-TO-DATE
[  +11 ms] > Task :firebase_core:prepareLintJarForPublish UP-TO-DATE
[        ] > Task :firebase_core:mergeDebugJavaResource UP-TO-DATE
[        ] > Transform artifact firebase-analytics-impl.aar
(com.google.firebase:firebase-analytics-impl:11.4.2) with DexingWithClasspathTransform
[   +8 ms] > Task :firebase_core:transformClassesAndResourcesWithSyncLibJarsForDebug
[        ] > Task :app:mergeExtDexDebug FAILED
[  +45 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[        ] Execution failed for task ':app:mergeExtDexDebug'.
[        ] > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
[        ]    > Failed to transform artifact 'firebase-analytics-impl.aar
(com.google.firebase:firebase-analytics-impl:11.4.2)' to match attributes {artifactType=android-dex,dexing-enable-desugaring=true, dexing-is-debuggable=true, dexing-min-sdk=21}.
[   +1 ms]       > Execution failed for DexingWithClasspathTransform:
C:\Users\Shivam\.gradle\caches\transforms-2\files-2.1\a2d4051f99ffbe9ad8884d8a69091e22\jetified-firebase-analytics-impl-11.4.2\jars\classes.jar.
[   +1 ms]          > Error while dexing.
[        ] * Try:
[        ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option toget more log output. Run with --scan to get full insights.
[   +1 ms] * Get more help at https://help.gradle.org
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle   
6.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See
https://docs.gradle.org/5.6.2/userguide/command_line_interface.html#sec:command_line_warnings       
[   +1 ms] 85 actionable tasks: 8 executed, 77 up-to-date
[        ] BUILD FAILED in 3s
[ +381 ms] Running Gradle task 'assembleDebug'... (completed in 3.9s)
[   +8 ms] "flutter run" took 5,250ms.
Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildGradleApp (package:flutter_tools/src/android/gradle.dart:387:7)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)       
#3      _rootRunUnary (dart:async/zone.dart:1134:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)       
#7      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:524:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#11     _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)       
#13     _rootRunUnary (dart:async/zone.dart:1134:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)       
#17     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
#20     _rootRun (dart:async/zone.dart:1126:13)
#21     _CustomZone.run (dart:async/zone.dart:1023:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:175:5)



PS D:\Shivam\Code\Flutter\new_app> 

PS D:\Shivam\Code\Flutter\new_app> flutter analyze
Analyzing new_app...
No issues found! (ran in 6.5s)
PS D:\Shivam\Code\Flutter\new_app>

PS D:\Shivam\Code\Flutter\new_app> flutter doctor -v
[√] Flutter (Channel dev, v1.12.10, on Microsoft Windows [Version 10.0.18363.476], locale en-US)
    • Flutter version 1.12.10 at C:\Programming\flutter
    • Framework revision b6e92003c8 (17 hours ago), 2019-11-22 15:02:20 -0800
    • Engine revision ad14574949
    • Dart version 2.7.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Shivam\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Programming\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

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

[√] Android Studio (version 3.5)
    • Android Studio at C:\Programming\Android Studio
    • Flutter plugin version 41.1.2
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.40.1)
    • VS Code at C:\Users\Shivam\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.25.1

[√] Connected device (3 available)
    • Nokia 6 1 Plus • 192.168.43.44:5555 • android-arm64  • Android 9 (API 28)
    • Chrome         • chrome             • web-javascript • Google Chrome 78.0.3904.108
    • Web Server     • web-server         • web-javascript • Flutter Tools

• No issues found!
PS D:\Shivam\Code\Flutter\new_app>
bug

Most helpful comment

Everything works if I use classpath 'com.google.gms:google-services:4.3.3' instead of classpath 'com.google.gms:google-services:3.2.1'
But https://codelabs.developers.google.com/codelabs/flutter-firebase/#6 specifies This line specifies version 3.2.1 of the plugin (do not use higher version).

All 6 comments

The commits in this repo from May 7 are : https://github.com/FirebaseExtended/flutterfire/commit/bc3462ac8b8d2d9d371b2e2cfdafdca6dcb088ef https://github.com/FirebaseExtended/flutterfire/commit/07819b42045080dc45ecf673b023ad459e7ad829
and similar for ios on May 16 : https://github.com/FirebaseExtended/flutterfire/commit/e92bbda854967ecc294fb72100487e487ce5f182
Might be helpful: https://firebase.google.com/support/release-notes/android#2019-05-07

The logs have this even though I've followed the firebase codelab exactly.

[+1327 ms] > Configure project :app
[        ] google-services plugin could not detect any version for com.google.android.gms or
com.google.firebase, default version: 11.4.2 will be used.
[  +15 ms] please apply google-services plugin at the bottom of the build file.
[   +1 ms] Could not find google-services.json while looking in [src/nullnull/debug,
src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
[  +54 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[   +4 ms] Could not find google-services.json while looking in [src/nullnull/release,
src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
[  +20 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[  +20 ms] Could not find google-services.json while looking in [src/nullnull/profile,
src/profile/nullnull, src/nullnull, src/profile, src/nullnullProfile]
[  +16 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

And the error message has Failed to transform artifact 'firebase-analytics-impl.aar (com.google.firebase:firebase-analytics-impl:11.4.2)'
It seems that after May 7 versions it can't find the applied plugin/API so it's using the default version 11.4.2 and that is causing the given error.

Everything works if I use classpath 'com.google.gms:google-services:4.3.3' instead of classpath 'com.google.gms:google-services:3.2.1'
But https://codelabs.developers.google.com/codelabs/flutter-firebase/#6 specifies This line specifies version 3.2.1 of the plugin (do not use higher version).

I have the same issue and it works with same same fix (though remember closing the string): classpath 'com.google.gms:google-services:4.3.3'

Using classpath 'com.google.gms:google-services:4.3.3' instead of the specified classpath 'com.google.gms:google-services:3.2.1' worked for me aswell!

I've experienced this myself as well; I'm trying to figure out how to get the codelab fixed.

I have published an update to the codelab, with the following changes:

  • Bump cloud_firestore dependency to ^0.13.0+1 (step 4)
  • Update gms:google-services gradle dependency to 4.3.3 (step 7)

Tested on iOS and Android on my repo, reviewed by @filiph.

Thanks for reporting!

Was this page helpful?
0 / 5 - 0 ratings