Flutterfire: [firebase_core] gradle error

Created on 13 Oct 2019  ·  10Comments  ·  Source: FirebaseExtended/flutterfire

Summary
I'm starting studying Flutter with Firebase. I have some experience with using Firebase through Kotlin android. When run a new flutter application which is completely new one through Android Studio, it works well. However, after finish settings for Firebase such as...

Adding google-services.json from Firebase project.

app/build.gradle apply plugin: 'com.google.gms.google-services'

android/build.gradle classpath 'com.android.tools.build:gradle:3.2.1'

pubspec.yaml firebase_core: ^0.2.5 # add dependency for Firebase Core

and below are
versions of

android studio 3.4.1

flutter --version
Flutter 1.9.1+hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 2d2a1ffec9 (10 days ago) • 2019-09-06 18:39:49 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0

gradle version : gradle-4.10.2-all.zip

When I ran, I've got
Error

* Error running Gradle:
ProcessException: Process "D:\DEV\flutter_firebase1\flutter_app\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon (subsequent builds will be faster)


FAILURE: Build failed with an exception.

* Where:
Build file 'D:\DEV\flutter_firebase1\flutter_app\android\app\build.gradle' line: 24

* What went wrong:
A problem occurred evaluating project ':app'.
> ASCII

* 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 24s
  Command: D:\DEV\flutter_firebase1\flutter_app\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.`

I swear I completely followed instruction of documentation of Firebase. And I tried it again with completely new project. How can I do for it?

android core bug documentation

Most helpful comment

Solved the issue by updating Project level build.gradle under dependencies classpath 'com.android.tools.build:gradle:3.5.1' and gradle-wrapper.properties to gradle-5.4.1-all

All 10 comments

@PE-Jeon

The issue at https://github.com/flutter/flutter/issues/40676 has been closed and moved here. Future collaboration on this issue will be done here.

Hi @PE-Jeon
could you please provide your 'flutter build --verbose`.
Thank you

It's a shame after so many videos and tutorials on flutter+firebase and problem is on initialization and no solution provided yet.

Solved the issue by updating Project level build.gradle under dependencies classpath 'com.android.tools.build:gradle:3.5.1' and gradle-wrapper.properties to gradle-5.4.1-all

Hi @PE-Jeon
did the proposed solution worked?
thank you @saadmahmud

@saadmahmud solution did not work for me. Cleaned the .gradle folder, set the mentioned versions but still getting the same error.

@gopchi are you able to run the example apps? For example the example app in firebase_core?

Solved the issue by updating Project level build.gradle under dependencies classpath 'com.android.tools.build:gradle:3.5.1' and gradle-wrapper.properties to gradle-5.4.1-all

This doesn't work for me. Everything seems OK before setting up firebase.

For now it successfully running on this configuration

File: android/build.gradle
ext.kotlin_version = '1.3.0' //previously 1.2.71
classpath 'com.android.tools.build:gradle:3.3.1' //previously 3.2.1

File: android/app/build.gradle under defaultConfig
applicationId "com.example.your_app_id" // change with your firebase project application id

NOTE: It just running test with firebase_core and firebase_auth only installed. I dont know about the future code deprecation

Hey, our firebase_core rework has now landed on master via #2890 - we hope to start publishing preview releases to test out next week which should solve this issue (and others).

Thank you for raising this issue 👍

Was this page helpful?
0 / 5 - 0 ratings