0

I got these error when build appbundle in flutter.

FAILURE: Build failed with an exception. Where: Build file 'C:\Users\fkucukali\StudioProjects\barkod_c\barkod_c\android\app\build.gradle' line: 32 What went wrong: A problem occurred evaluating project ':app'. No signature of method: build_mqimfyb9oamvwvn8z5rtwvyi.android() is applicable for argument types: (build_mqimfyb9oamvwvn8z5rtwvyi$_run_closure2) values: [build_mqimfyb9oamvwvn8z5rtwvyi$_run_closure2@1779860b]

app/build.gradle

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"
def keyProperties = new Properties()
    def keyPropertiesFile = rootProject.file('key.properties')
    if(keyPropertiesFile.exists()){
        keyProperties.load(new FileInputStream(keyPropertiesFile))
    }

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.barkod_c"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    signingConfig{
        release{
            keyAlias keyProperties['keyAlias']
            keyPassword keyProperties['keyPassword']
            storeFile keyProperties['storeFile']? file(keyProperties['storeFile']) : null
            storePassword keyProperties['storePassword']
        }
    }

    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.release
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "androidx.multidex:multidex:2.0.1"
}

Do you know how this problem can be solved?

  • Add your app/build.gradle file if possible. – Yashraj Sep 27 '21 at 11:42
  • Check This : https://stackoverflow.com/questions/61807520/how-to-fix-error-no-signature-of-method-build-ap86oam3dut3pxce3x49rdtma-androi?page=1&tab=active#tab-top – Yashraj Sep 27 '21 at 12:17

0 Answers0