首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >未解析参考BuildConfig

未解析参考BuildConfig
EN

Stack Overflow用户
提问于 2019-11-30 21:09:13
回答 4查看 6.1K关注 0票数 9

当我试图重建我的项目时,我会得到以下错误:

代码语言:javascript
运行
复制
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等等,但都没有用。

谢谢你的帮助。

EN

Stack Overflow用户

发布于 2021-09-21 17:25:47

在我清理和重建项目之后,仍然面临着这个问题。

对我来说,这是gradle文件的错误:S,在您的buildType中检查是否存在错误。

代码语言:javascript
运行
复制
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 "....."}
票数 1
EN
查看全部 4 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59120296

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档