gpt4 book ai didi

Android 构建错误 : Attribute Signature requires InnerClasses attribute. 检查 -keepattributes 指令

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:56:00 24 4
gpt4 key购买 nike

尝试在 Release模式下构建应用程序时遇到此错误。

Error: Attribute Signature requires InnerClasses attribute. Check -keepattributes directive

我的 proguard-rules.pro 行如下所示:

-keepattributes Signature

编译器指的是什么内部类?我遗漏了什么?

最佳答案

签名(Java 8 或更高版本)仅适用于 Java 8 或更高版本和 InnerClasses(Java 5 或更高版本),因此请检查您的 Android Studio 使用的是 Java SDK 版本。请使用以下设置更新您的 Proguard 配置

将此行添加到您的 proguard-rules.pro 文件中:

-keepattributes InnerClasses

InnerClasses (Java 5 or higher)

Specifies the relationship between a class and its inner classes and outer classes. Other than this and the naming convention with a '$' separator between the names of inner classes and outer classes, inner classes are just like ordinary classes. Compilers may need this information to find classes referenced in a compiled library. Code may access this information by reflection, for instance to derive the simple name of the class.

Signature (Java 8 or higher)

Specifies the generic signature of the class, field, or method. Compilers may need this information to properly compile classes that use generic types from compiled libraries. Code may access this signature by reflection.

有关 -keepattributes 的更多详细信息以及您可以应用的更多设置,请参阅下面的链接。

Proguard options

关于Android 构建错误 : Attribute Signature requires InnerClasses attribute. 检查 -keepattributes 指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52252806/

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