0

These are the packages and there versions

firebase_core: ^0.7.0
firebase_auth: ^0.20.0
firebase_analytics: ^7.0.1
firebase_admob: ^0.11.0+1
cloud_firestore: ^0.16.0
meta: ^1.2.4

Gradle Properties

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
  • Compiled SDK version: 29
  • Minimum SDK version: 23
  • Target SDK version: 29

The result when building the app

BUILD FAILED in 5m 30s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                       334.2s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
Exception: The plugin cloud_firestore could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'...   
Ahmad Jaber
  • 23
  • 1
  • 9

2 Answers2

1

I encountered the same error and I fixed it by updating my Graddle, try this one:

android/build.gradle:

dependencies {
   classpath 'com.android.tools.build:gradle:4.1.1'
}

then update the distributionUrl in gradle-wrapper.properties:

distributionUrl = https\://services.gradle.org/distributions/gradle-6.5-all.zip
JM Gelilio
  • 3,482
  • 1
  • 11
  • 23
0

In my case, the solution was:

1- android/build.gradle:

dependencies {
   classpath 'com.android.tools.build:gradle:4.0.0'
}

2- gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

3- Run Command:

flutter channel master

4- Run Command:

flutter clean
Ahmad Jaber
  • 23
  • 1
  • 9