1

I've been struggling a lot with the following build error after upgrading Firebase libs on pubspec.yaml. It is related to https://github.com/FirebaseExtended/flutterfire/issues/17, but no solution so far. Can anyone help me please?

What went wrong:                                                      
Execution failed for task ':firebase_core:generateReleaseRFile'.        
> Could not resolve all files for configuration ':firebase_core:releaseCompileClasspath'.
   > Could not find com.google.firebase:firebase-common:.               
     Required by:                                                       
         project :firebase_core

(I am facing this too: It stops recognizing the GradleException inside of a build.gradle)

Flutter doctor

[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Android Studio (version 4.1)

Pubspec

  firebase_auth: ^1.0.1
  cloud_firestore: ^1.0.1
  firebase_database: ^6.1.0
  firebase_core: 1.0.1
  google_sign_in: ^5.0.1

Dependencies on build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.3'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.5'
    }

Dependencies on app/build.gradle

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.firebase:firebase-bom:26.8.0'
    implementation 'com.google.android.gms:play-services-base:17.6.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'com.google.firebase:firebase-core:11.0.4'
    implementation 'com.google.firebase:firebase-auth:19.7.0'
    implementation 'com.google.firebase:firebase-database:19.7.0'
    implementation 'com.google.firebase:firebase-firestore:19.7.0'
}

I have already tried, but nothing worked:

  • decrease to classpath 'com.google.gms:google-services:3.2.1'
  • flutter clean and packages upgrade
  • Invalidaded Caches/Restart

Can anyone help me please? 2 days in a row and 0 evidence of what could be causing this. Thanks in advance!

1 Answer 1

1

removed external firebase SDK version set in build.gradle file

rootProject.ext {

set('FlutterFire', [
        FirebaseSDKVersion: '25.12.0'
])
}

after removing these file it work's for me

1
  • can you please show a before and after of the code changed, thank you
    – Alex
    Commented Jan 18, 2022 at 19:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.