android - ProGuard 构建警告 - org.apache.http.entity

标签 android android-studio gradle

我收到以下构建错误和更多相同的错误:

Warning: org.apache.http.entity.mime.MultipartEntity: can't find referenced method 'org.apache.james.mime4j.message.Body getBody()' in program class org.apache.http.entity.mime.FormBodyPart

但我的 ProGuard 规则中有:

-保持类 org.apache.http.** { *; }

-keep class org.apache.james.mime4j.** { *; }

那么为什么我会收到此警告并且构建失败?

最佳答案

因为org.apache.james.mime4j.message.Body是一个接口(interface)。像这样更新你的 ProGuard 规则,

-keep class org.apache.** { *; }
-keep interface org.apache.** { *; }
-keep enum org.apache.** { *; }

添加 -keep用于需要的接口(interface)和枚举。

关于android - ProGuard 构建警告 - org.apache.http.entity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34515421/

相关文章:

android - java.lang.RuntimeException : Unable to instantiate activity ComponentInfo/is not accessible from class 错误

java - 如何使用 CheckBox 在 ExpandableListView 中隐藏特定组

android - 如何在Gradle中排除androidx库的所有版本文件?

Android 无法通知项目评估监听器

安卓视频播放器问题

java - 将月份作为 01,02 而不是 1,2

java - 如何在 android eclipse 中创建本地高分列表?

java - 如何初始化 android 的 instabug?

Android Gradle Dependency 与 Android 提供的内部版本冲突

android - 错误 :Execution failed for task ':app:processDebugManifest'