【问题标题】:Proguard Overflow of unsigned short value无符号短值的 Proguard 溢出
【发布时间】:2021-01-14 12:09:53
【问题描述】:

在向我的应用程序添加包含一些我需要的功能的 jar 文件后,我的 proguard 构建没有工作。运行我的 proguard 构建后收到的错误消息是:

Warning: Exception while processing task java.io.IOException: java.lang.RuntimeException: Unexpected error while writing class [proguard/optimize/gson/_OptimizedTypeAdapterFactory] (Overflow of unsigned short value [93362])
Thread(Tasks limiter_1): destruction

有什么方法可以排除这个 jar 文件被 ProGuard 检查?我正在使用 ProGuard v6.2.2。我怀疑问题是 GSON,因为在此错误之前我遇到了问题。

我也在这里检查和研究了答案,例如Proguard [ java.lang.IllegalArgumentException: Overflow of unsigned short value ]

Android crash while using GSON Library and ProGuard

#732 Exception while handling very long string argument

任何帮助将不胜感激。

【问题讨论】:

    标签: android proguard


    【解决方案1】:

    您可以在此处阅读有关 ProGuard 配置和优化的更多信息:

    https://www.guardsquare.com/en/products/proguard/manual/usage/optimizations

    但在您的情况下,您可以排除抛出异常的 gson 库,如下所示:

    -optimizations !library/gson
    

    【讨论】:

      【解决方案2】:

      这是一个已知的错误。在此问题得到纠正之前,您只能禁用代码优化:

      -optimizations !code/simplification/string
      

      或使用-dontoptimize 完全禁用优化。或者只使用 R8 ...

      暗示版本降级的一个链接答案也可能有效。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-04-23
        • 2012-02-29
        • 2016-05-22
        • 1970-01-01
        • 1970-01-01
        • 2020-06-07
        相关资源
        最近更新 更多