question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Gradle error with com.google.gms:google-services:4.3.2

See original GitHub issue

Hi,

I’m trying to test Firebase on Flutter and I did follow the instructions of the web site and I had the following error:

* Error running Gradle:
ProcessException: Process "....\firebase_test1\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Build file '...\firebase_test1\android\app\build.gradle' line: 24

Line 24 has this code: apply plugin: ‘com.android.application’

BTW, If I run Gradle directly from the command line threre is no error at all:

Welcome to Gradle 4.10.2.
To run a build, run gradlew <task> ...
To see a list of available tasks, run gradlew tasks
To see a list of command-line options, run gradlew --help
To see more detail about a task, run gradlew help --task <task>
For troubleshooting, visit https://help.gradle.org
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed

If I change classpath ‘com.google.gms:google-services:4.3.2’ to classpath ‘com.google.gms:google-services:4.2.0’, the problem dissapears.

Version info

C:\flutter\bin\flutter.bat doctor --verbose [√] Flutter (Channel stable, v1.9.1+hotfix.4, on Microsoft Windows [Versión 10.0.17134.1006], locale es-ES) • Flutter version 1.9.1+hotfix.4 at C:\flutter • Framework revision cc949a8e8b (4 days ago), 2019-09-27 15:04:59 -0700 • Engine revision b863200c37 • Dart version 2.5.0

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

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

[√] VS Code, 32-bit edition (version 1.35.1) • VS Code at C:\Program Files (x86)\Microsoft VS Code • Flutter extension version 3.1.0

[√] Connected device (1 available) • Pixel 2 XL • 711KPQJ0575612 • android-arm64 • Android 10 (API 29)

• No issues found! Process finished with exit code 0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
TheWCKDcommented, Dec 16, 2019

For me the following method worked and fixed the issue (on VSCode)

  1. Open up {project}/android/build.gradle and modify the following dependencies as seen below
  • classpath ‘com.android.tools.build:gradle:3.5.3’
  • classpath ‘com.google.gms:google-services:4.3.3’
  1. Open up {project}/android/gradle/wrapper/gradle-wrapper.properties and update this line
  • distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip
  1. Run your flutter app with Ctrl+F5 and wait for the wrapper to do its job. Voila!
3reactions
gokhangencercommented, Dec 12, 2019

It is resolved,

I have upgraded from flutter_windows_v1.9.1+hotfix.6-stable to v1.12.13+hotfix.5 via flutter https://flutter.dev/docs/development/tools/sdk/upgrading

then, remove line: apply plugin: ‘com.google.gms.google-services’

open android studio, sync gradle and connect to firebase (tools\firebase\authentication\connect to firebase).

then you can return to vscode and run

add line: apply plugin: ‘com.google.gms.google-services’

flutter run succeed and google sign in works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: gradle and gms google-services - Stack Overflow
It happens because the android plugin for gradle 3.2.0 (as stable release) doesn't exist. Use:
Read more >
The Google Services Gradle Plugin
Q: When building I get the following error message: "File google-services.json is missing from module root folder. The Google Services Plugin cannot function ......
Read more >
Add build dependencies - Android Developers
The Gradle build system in Android Studio makes it easy to include external binaries or other library modules to your build as dependencies....
Read more >
Fixing metadata with component metadata rules
In the build script, we can now request a specific variant and Gradle will fail with a selection error if more information is...
Read more >
Android Gradle plugin 3.2.0-beta01: No such property
3.2.0-alpha18 did not have this issue. ... Build: 3.2 Beta 1, AI-181.4892.42.32.4847800, 201806182334, ... at com.google.protobuf.gradle.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found