Flutterfire: [firebase_crashlytics] Gradle build failed

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

I am trying to integrate firebase crashlytics into my Android project following the docs and ended up with gradle build falilure:

FAILURE: Build failed with an exception.

* Where:
Build file 'F:\Flutter\Projects\Alola\android\app\build.gradle' line: 24

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

After some struggling I was able to find the cause for it is because of the google service's version specified in the doc . After I downgrade google service version from 4.3.0 to 4.2.0 then the error is gone.

My Flutter doctor output:

[√] Flutter (Channel beta, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17134.885], locale vi-VN)
    • Flutter version 1.7.8+hotfix.4 at F:\Flutter\flutter_windows_v0.7.3-beta\flutter
    • Framework revision 20e59316b8 (3 weeks ago), 2019-07-18 20:04:33 -0700
    • Engine revision fee001c93f
    • Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at F:\AndroidSDK
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_HOME = F:\AndroidSDK;F:\AndroidSDK\platform-tools\;
    • Java binary at: F:\AndroidStudio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at F:\AndroidStudio
    • Flutter plugin version 38.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code, 64-bit edition (version 1.31.1)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.23.0

[√] Connected device (2 available)
    • D6603                        • BH902VHB1L    • android-arm • Android 6.0.1 (API 23)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 8.0.0 (API 26) (emulator)
customer-response bug

Most helpful comment

I just tested this solution from https://github.com/flutter/flutter/issues/38163#issuecomment-539054967, and seems to work:

Update the following files:

  • android/app/build.gradle
  1. Change xt.kotlin_version = '1.2.71' to ext.kotlin_version = '1.3.50'
  2. Change classpath 'com.android.tools.build:gradle:3.2.1' to => classpath 'com.android.tools.build:gradle:3.5.0'.
  • android/gradle/wrapper/gradle-wrapper.properties
  1. Chage distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip version from 4.10.2 to 5.6.2

All 8 comments

@TheVinhLuong

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

Hi @TheVinhLuong
I see from your flutter doctor that you are using an older version of Flutter,
are you experiencing the same issues with the latest stable flutter version?
Also, to better address the issue, would be helpful
if you could post your flutter run --verbose / flutter build --verbose.
Thank you

@iapicca this problem occurs immediately you open 'flutter_app\android\app\build.gradle', even in a newly created flutter app- the build.gradle gets underlined with red marker in android studio. i have been stuck on this for three weeks now. i deleted my android studio along with all files associated with it, deleted the android sdk as well and installed everything including flutter sdk again but arrived at the same problem. please i need a fix.

@iapicca Your issue seems to be different from the one identified by @TheVinhLuong. Also since it is not related to Firebase I'd suggest filing an issue on the flutter/flutter repository.

Changing version from 4.3.2 => 4.2.0 didn't help. Any other solution?

I just tested this solution from https://github.com/flutter/flutter/issues/38163#issuecomment-539054967, and seems to work:

Update the following files:

  • android/app/build.gradle
  1. Change xt.kotlin_version = '1.2.71' to ext.kotlin_version = '1.3.50'
  2. Change classpath 'com.android.tools.build:gradle:3.2.1' to => classpath 'com.android.tools.build:gradle:3.5.0'.
  • android/gradle/wrapper/gradle-wrapper.properties
  1. Chage distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip version from 4.10.2 to 5.6.2

Hi @@TheVinhLuong
does the proposed solution works for you?
thank you

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so its always better to open new issues and reference related issues.

Was this page helpful?
0 / 5 - 0 ratings