简体   繁体   English

Proguard 警告“找不到引用的 class packagename.R$string ”与 gradle 3.3.0

[英]Proguard warning “Can't find referenced class packagename.R$string ” with gradle 3.3.0

Proguard fails with warning after updating gradle plugin to '3.3.2'.将 gradle 插件更新为“3.3.2”后,Proguard 失败并出现警告。 The warning is: "Can't find referenced class packagename.R$string "警告是:“找不到引用的 class packagename.R$string”

it's working fine with gradle plugin '3.2+'它与 gradle 插件“3.2+”一起工作正常

The issue might be because of(As per behavioural changes of 3.3):问题可能是因为(根据 3.3 的行为变化):

Faster R class generation for library projects: Previously, the Android Gradle plugin would generate an R.java file for each of your project's dependencies and then compile those R classes alongside your app's other classes. Faster R class generation for library projects: Previously, the Android Gradle plugin would generate an R.java file for each of your project's dependencies and then compile those R classes alongside your app's other classes. The plugin now generates a JAR containing your app's compiled R class directly, without first building intermediate R.java classes. The plugin now generates a JAR containing your app's compiled R class directly, without first building intermediate R.java classes. This optimization may significantly improve build performance for projects that include many library subprojects and dependencies, and improve the indexing speed in Android Studio.这种优化可以显着提高包含许多库子项目和依赖项的项目的构建性能,并提高 Android Studio 中的索引速度。

apply below codes to your gradle.properties file.将以下代码应用于您的gradle.properties文件。

# Disables R8 for Android Library modules only.
android.enableR8.libraries = false

# Disables R8 for all modules.
android.enableR8 = false

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

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