android - 无法构建 APK

标签 android jar proguard android-proguard

我正在尝试构建 APK。但我正面临错误。但我可以使用 USB 调试直接运行它。

Error:12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"(com.starmicronics.starioextension.commandbuilder.c) that doesn\u0027t come with an","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"(com.starmicronics.starioextension.commandbuilder.d) that doesn\u0027t come with an","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
12:16:10.220 [ERROR] [org.gradle.api.Project] AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}

12:16:10.235 [ERROR] [org.gradle.BuildExceptionReporter] 
12:16:10.235 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.

最佳答案

您正在使用以错误方式创建的库(看起来像 com.starmicronics...)。

如果可用,您可以自己从源代码重新编译库,否则,您应该能够通过将以下内容添加到混淆器配置文件来防止警告:

-dontwarn com.starmicronics.starioextension.**

关于android - 无法构建 APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38843958/

相关文章:

android - 同时使用 ProGuard 和 R8

android - 在后台运行 native 代码

Android - 未捕获的 NPE,具有基本的应用计费尝试

java - 在没有 main 的情况下执行 jar?

java - hibernate从3.6.5升级到4.3.5时更换jar

android - 转换为 Dalvik 格式异常 : Invalid dex bytecode offset

java - 有关 ProGuard、Launch4j 的详细信息?

android - Kotlin 延迟初始化与 Dagger 延迟注入(inject)

android - 启动不支持多窗口的新 Activity

jar - 将 jruby on rails 应用程序编译为 jar?