0

I tried to run my first firebase application but it didn't work because of this error :

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\boras\OneDrive\Masaustu\Software\ProgramlamaTemelliYazilim\Flutter\firebase_application\firebase_application\android\app\build.gradle' line: 29
  • What went wrong: A problem occurred evaluating project ':app'.

No signature of method: build_884xt67ny8crpgv70jgbem96p.android() is applicable for argument types: (build_884xt67ny8crpgv70jgbem96p$_run_closure2) values: [build_884xt67ny8crpgv70jgbem96p$ure2) values: [build_884xt67ny8crpgv70jgbem96p$_run_closure2@1998e9ac]

  • 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

And this is what i android/app/build.gradle looks like :

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 30

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.firebase_application"
        minSdkVersion 23
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
        classpath 'com.android.tools.build:gradle:4.2.0'

    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation platform('com.google.firebase:firebase-bom:26.3.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-messaging'

    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    compile 'com.android.support:multidex:2.0.1'
    implementation platform('com.google.firebase:firebase-bom:28.3.0')
    classpath 'com.google.gms:google-services:4.2.0'
}

1 Answer 1

1

Try to change your below virsions after flutter upgrade:

compileSdkVersion 33

minSdkVersion 28

targetSdkVersion 33
Sign up to request clarification or add additional context in comments.

1 Comment

It didn't worked, still have the same issue

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.