skip to Main Content

My project ran on the device successfully but when I upgraded my project BuildConfig file did not resolve

classpath 'com.android.tools.build:gradle:8.0.1'

distributionUrl=https://services.gradle.org/distributions/gradle-8.0-bin.zip

compileOptions {
    sourceCompatibility JavaVersion.VERSION_17
    targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
    jvmTarget = JavaVersion.VERSION_17.toString()
}

I have done Invalidate Caches... and Sync Project with gradle files but BuildCongfig file could not resolve.

I created a new project but in that project same issue exists.

2

Answers


  1. Adding buildConfig true to build.gradle solved the issue for me.

    android {
      buildFeatures {
        buildConfig true
      }
    }
    
    Login or Signup to reply.
  2. I was having issue resolving BuildConfig in Android Studio Flamingo. By adding this line to gradle.properties fixed my issue.

    android.defaults.buildfeatures.buildconfig=true
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search