Skip to content

Commit bc4c5bc

Browse files
committed
Build: Enable build config build feature for app
This is an AGP version '8.0' breaking change that changes the build option default values, see build failure below: ------------------------------------------------------------------------ FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':stories'. > Failed to notify project evaluation listener. > com.android.builder.errors.EvalIssueException: Build Type 'debug' contains custom BuildConfig fields, but the feature is disabled. > Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component .DefaultSoftwareComponentContainer. ------------------------------------------------------------------------ > Task :app:compileDebugKotlin FAILED e: /Users/.../app/src/main/kotlin/org/wordpress/aztec/demo/ MainActivity.kt: (680, 21): Unresolved reference: BuildConfig FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner .GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction > Compilation error. See log for more details ------------------------------------------------------------------------ Explanation: "Starting with AGP 8.0, the default values for these flags have changed to improve build performance. AGP 8.0 doesn't generate 'BuildConfig' by default. You need to specify this option using the DSL in the projects where you need it." For more info see: https://developer.android.com/build/releases/ gradle-plugin#default-changes
1 parent 1970f75 commit bc4c5bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ android {
3232
lintOptions {
3333
disable 'GradleCompatible'
3434
}
35+
36+
buildFeatures {
37+
buildConfig true
38+
}
3539
}
3640

3741
dependencies {

0 commit comments

Comments
 (0)