Maksim Turaev
Maksim Turaev

Reputation: 4325

Could not find method bundle()

I am trying to build appbundle in my project. I follow steps from official guide but getting following error on gradle sync. What can be wrong?

   * What went wrong:
    A problem occurred evaluating project ':MyProject'.
    > Could not find method bundle() for arguments [build_4ng76ykxfhsfa1nuepa3fikmu$_run_closure5$_closure28@6448fs70] on object of type com.android.build.gradle.AppExtension.

I added android.enableAapt2=true to gradle.properties file and run ./gradlew --stop

Upvotes: 3

Views: 3474

Answers (3)

Maksim Turaev
Maksim Turaev

Reputation: 4325

I missed plugin version, If someone face same stacktrace. Please check plugin version.

Update Android gradle plugin version to 3.2.0 or later

classpath "com.android.tools.build:gradle:3.2.0"

Upvotes: 1

KeithXiaoY
KeithXiaoY

Reputation: 1

signingConfigs {
    debug {
        keyAlias 'xxxxxx'
        keyPassword 'xxxxx'
        storeFile file('xxxxx')
        storePassword 'xxxxx'
    }
    releaseConfig {}
}

you maybe lost signingConfigs {} which is the curly braces, i add this then anything is well.

you may try it

Upvotes: 0

Pierre
Pierre

Reputation: 17397

I believe the task you're looking for is bundleRelease or bundleDebug.

Upvotes: 0

Related Questions