gpt4 book ai didi

android - 使用 R8 构建发布 apk 时缺少类 com.google.errorprone.annotations.Immutable

转载 作者:行者123 更新时间:2023-12-04 23:51:31 29 4
gpt4 key购买 nike

在启用 R8 的情况下构建发布 apk 时出现以下错误:

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文件的内容:
# 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在 pro-guard 规则中或添加一些 -keep规则?

最佳答案

当涉及到单个文件(而不是整个包)时,您最好保留而不是丢弃任何警告。这对您的 apk 并没有增加太多。

-keep class com.google.errorprone.annotations.Immutable

关于android - 使用 R8 构建发布 apk 时缺少类 com.google.errorprone.annotations.Immutable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69242193/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com