New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not find BuildConfig in a java file #27
Comments
If anyone has a solution please suggest this problem :( |
Just run gradle compileBuildConfig in your terminal of course inside the project |
I have had this problem too. |
If the problem is that the file was not created, just run gradle compileBuildConfig or build, as other already answered. If the problem is that the file was created but your IDE is not recognizing it, if your IDE is IntelliJ adding this to your gradle might help: build.gradle.kts (it's similar in groovy) plugins {
...
kotlin("jvm") version "1.6.20"
id("idea")
}
// For Kotlin (similar for Java)
kotlin {
sourceSets {
main {
this.kotlin.srcDir("$buildDir/gen/buildconfig/src/")
}
}
}
idea {
module {
// Tell idea to mark the folder as generated sources
generatedSourceDirs.add(File("$buildDir/gen/buildconfig/src/"))
}
} |
Can not find BuildConfig in a java file.
plugins {
id 'java'
id 'de.fuerstenau.buildconfig' version '1.1.8'
}
version '0.1'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
test {
useTestNG()
}
buildConfig {
buildConfigField 'String', 'MY_STR_FIELD', '"my message to the app"'
}
dependencies {
compile group: 'org.testng', name: 'testng', version: '6.14.3'
compile group: 'io.appium', name: 'java-client', version: '6.1.0'
}
apply plugin: 'idea'
The text was updated successfully, but these errors were encountered: