首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用com.google.errorprone.annotations.Immutable构建发布版apk时缺少类R8

在使用com.google.errorprone.annotations.Immutable构建发布版apk时缺少类R8
EN

Stack Overflow用户
提问于 2021-09-19 09:57:14
回答 1查看 1.3K关注 0票数 4

在构建启用R8的发行版apk时,我遇到了下面的错误:

代码语言:javascript
复制
Task :app:minifyReleaseWithR8
AGPBI: {"kind":"warning","text":"Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in C:\\Users\\y509118\\AndroidStudioProjects\\SafeBox\\app\\build\\outputs\\mapping\\release\\missing_rules.txt.\n","sources":[{}]}
AGPBI: {"kind":"warning","text":"Missing class com.google.errorprone.annotations.Immutable (referenced from: com.google.crypto.tink.KeyTemplate and 4 other contexts)","sources":[{}],"tool":"R8"}
Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in C:\Users\y509118\AndroidStudioProjects\SafeBox\app\build\outputs\mapping\release\missing_rules.txt.


Missing class com.google.errorprone.annotations.Immutable (referenced from: com.google.crypto.tink.KeyTemplate and 4 other contexts)

上述missing_rules文件的内容:

代码语言:javascript
复制
# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.-dontwarn com.google.errorprone.annotations.Immutable

我应该在支持保护规则中添加-dontwarn或者添加一些-keep规则吗?

EN

回答 1

Stack Overflow用户

发布于 2022-02-18 03:20:51

当涉及到单个文件(而不是整个包)时,最好保持和不丢弃任何警告。这对你的生活并没有多大帮助。

代码语言:javascript
复制
-keep class com.google.errorprone.annotations.Immutable
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69242193

复制
相关文章

相似问题

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