skip to Main Content

I am building a flutter app with Visual Code, version 1 of the app worked fine, including building and signing my APKs with Flutter build apk.

Then I introduced firebase and Firecore, and after completion of the app… I cannot build my APK anymore. I strongly suspect I am doing stuff wrong in my gradle files. But I am just not clever enough to find out what. Been searching for countless hours, but no luck yet.

Hope you guys can help me out.

I tried adjust my gradle files multiple times, no luck yet

I appreciate the help and explanations.

I will put my gradle files under the error

The latest error when I try to inspect the gradle with

gradle build –scan –warning-mode all

https://gradle.com/s/jt6ihjarbqzr4

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > C

project level


buildscript {
        ext.kotlin_version = '1.9.23' 

    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.6'
        classpath 'com.google.gms:google-services:4.4.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    }
}

plugins {
    id 'com.android.application' version '8.3.1' apply false
    id 'com.google.gms.google-services' version '4.4.1' apply false
}

repositories {
    google() 
    mavenCentral() 
}



allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

app level

plugins {
  id 'com.android.application'
  id 'com.google.gms.google-services'
  id 'kotlin-android'

}

android {
    namespace "com.berksport_app"
    compileSdkVersion 33

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 32
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

}

dependencies {
    implementation(platform("com.google.firebase:firebase-bom:32.8.0"))
    implementation 'androidx.appcompat:appcompat-resources:1.6.1'
    implementation("com.google.firebase:firebase-auth")
    implementation("com.google.firebase:firebase-firestore")
    implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.9'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}

2

Answers


  1. Chosen as BEST ANSWER

    Well let me thank you right now! Thanks good sir!


  2. targetSdkVersion 33

    override your dev dependency

    dependency_overrides:
    firebase_core: ^2.4.1

    Re build your project
    flutter clean
    flutter pub get

    Another way to solve it

    flutter pub upgrade –major-versions

    Thanks me later…..

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search