当我试图重建我的项目时,我会得到以下错误:
warning: flag is not supported by this version of the compiler: -Xallow-no-source-files
warning: flag is not supported by this version of the compiler: -Xjava-source-roots=/Users/tyln/AndroidStudioProjects/PhoneBox/base/navigation/build/generated/source/buildConfig/dev/debug
base/navigation/src/main/java/com/raqun/phonebox/navigation/IntentLoader.kt:7:9: error: unresolved reference: BuildConfig
BuildConfig.PACKAGE_NAME,
^
> Task :base:navigation:compileDevDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':base:navigation:compileDevDebugKotlin'.
> Compilation error. See log for more details
当我检查这个类时,没有未解决的引用。
我正在使用Gradle版本的3.3.1
我几乎什么都试过了,比如Invalidate Cache / Restart, Clean and Rebuild, Close and Reopen project, Reimport project, delete idea folder
等等,但都没有用。
谢谢你的帮助。
发布于 2021-09-21 17:25:47
在我清理和重建项目之后,仍然面临着这个问题。
对我来说,这是gradle文件的错误:S,在您的buildType中检查是否存在错误。
buildTypes {
deubg { <- it should be "debug"
buildConfigField "String", "URL_BASE_DEBUG", '"https://example.example.com"'
buildConfigField "String", "TOKEN_DEBUG", '"********"'
buildConfigField "....."}
release {
buildConfigField "String", "URL_BASE_PROD", '"https://example.example.com"'
buildConfigField "String", "TOKEN_¨PROD", '"********"'
buildConfigField "....."}
https://stackoverflow.com/questions/59120296
复制相似问题