'A problem occurred evaluating project ':app'. > No signature of method: build_3p

When running the flutter build appbundle command this error is shown:

enter image description here

  • Where: Build file 'C:\Projetos\Vai para o GitHub\devstravel\android\app\build.gradle' line: 38

    • What went wrong: A problem occurred evaluating project ':app'.

    No signature of method: build_3p7kb4yalue4j0dkob18nu1yo.android() is applicable for argument types: (build_3p7kb4yalue4j0dkob18nu1yo$_run_closure2) values: [build_3p7kb4yalue4j0dkob18nu1yo$_run_closure2@2d50add8]

    • 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.


I don't understand why this is wrong, I'm uploading my 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 keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')

if (keystorePropertiesFile.exists()){
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}



android {
    compileSdkVersion flutter.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    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.junior.devstravel"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    signingConfigs{
        release{
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties ['keyPassword']
            storeFile keystoreProperties ['storeFile'] ? file(keystoreProperties['storeFile']) : null
            sotePassword keystoreProperties ['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"
}


Solution 1:[1]

The solution to the problem was very simple! I mistyped storePassword

signingConfigs{
    release{
        keyAlias keystoreProperties['keyAlias']
        keyPassword keystoreProperties ['keyPassword']
        storeFile keystoreProperties ['storeFile'] ? file(keystoreProperties['storeFile']) : null
        **sotePassword** keystoreProperties ['storePassword']
    }
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Júnior Nogueira