简体   繁体   English

Android Studio 3.6 更新后 BuildConfig.FLAVOR 出现问题

[英]Issue with BuildConfig.FLAVOR after Android Studio 3.6 update

Anyone experiencing issues with BuildConfig.FLAVOR parameter?有人遇到BuildConfig.FLAVOR参数问题吗? After Android Studio 3.6 update all of my BuildConfig usages in code were red (as if the import was removed) and I can't override it from app config, only from Crashlytics and other sources.Android Studio 3.6更新后,我在代码中的所有BuildConfig用法都是红色的(就像删除了导入一样),我无法从应用程序配置中覆盖它,只能从Crashlytics和其他来源覆盖。 It has critical functionality in my app to load the right URL for API calls based on different flavors.它在我的应用程序中具有关键功能,可以根据不同的风格为 API 调用加载正确的 URL。

Try to reganerate all auto generate files of gradle again.再次尝试重新生成所有自动生成的 gradle 文件。

Build -> Run Generate Sources Gradle Tasks构建 -> 运行生成源 Gradle 任务

I used Build -> Clean Project and then File -> Invalidate Caches / Restart .我使用了Build -> Clean Project然后File -> Invalidate Caches / Restart It was still red after rebuilding, but as I build my App on smartphone it suddenly worked and red color disappeared.重建后它仍然是红色的,但是当我在智能手机上构建我的应用程序时,它突然起作用了,红色消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM