【问题标题】:Android ant build: proguard can't find referenced method in class ViewConfigurationCompatFroyoAndroid ant 构建:proguard 在 ViewConfigurationCompatFroyo 类中找不到引用的方法
【发布时间】:2011-10-27 03:02:51
【问题描述】:

我在这里的时间很短,所以我真的希望这里有人知道如何解决这些问题:

[proguard] Warning: android.support.v4.view.ViewConfigurationCompatFroyo: can't find referenced method 'int getScaledPagingTouchSlop()' in class android.view.ViewConfiguration
[proguard] Note: org.codehaus.jackson.map.deser.BasicDeserializerFactory: can't find dynamically referenced class java.util.ConcurrentNavigableMap
[proguard] Note: org.codehaus.jackson.map.deser.BasicDeserializerFactory: can't find dynamically referenced class java.util.ConcurrentSkipListMap
[proguard] Note: there were 2 unresolved dynamic references to classes or interfaces.
[proguard]       You should check if you need to specify additional program jars.
[proguard] Warning: there were 1 unresolved references to program class members.
[proguard]          Your input classes appear to be inconsistent.
[proguard]          You may need to recompile them and try again.
[proguard]          Alternatively, you may have to specify the options
[proguard]          '-dontskipnonpubliclibraryclasses' and/or
[proguard]          '-dontskipnonpubliclibraryclassmembers'.

我已经尝试添加多个内容:

-dontwarn **CompatHoneycomb
-dontwarn **CompatCreatorHoneycombMR2
-keep class android.support.v4.** { *; }

还有(对于杰克逊错误):

-libraryjars /Libraries/Joda/joda-time-1.6.2.jar
-libraryjars /Libraries/stax2-api-3.0.0.jar
-libraryjars /Libraries/jsr311-api-0.8.jar
-libraryjars /Libraries/httpmime-4.0.1.jar

任何人都知道我的 proguard.cfg 中缺少这些参考资料吗?或者可能有一些关于如何更普遍地调查/解决它的提示?

我将它从 472 个警告减少到这些,主要是通过添加 dontwarn 语句: -dontwarn java.awt.,javax.security.,java.beans.,javax.xml.,java.util.,org.w3c.dom。

编辑:迁移到答案

【问题讨论】:

  • 这仍然是一个“未回答”的问题。你能回答你自己的问题然后接受那个答案吗?这会将其从“未答复”列表中删除。
  • 我已将您的编辑迁移到您的答案,现在您只需接受它。

标签: android proguard obfuscation


【解决方案1】:
-dontwarn **CompatHoneycomb
-dontwarn **CompatCreatorHoneycombMR2
-dontwarn android.support.v4.view.**
-keep class android.support.v4.** { *; }

-dontwarn java.awt.**,javax.security.**,java.beans.**,javax.xml.**,java.util.**,org.w3c.dom.**

【讨论】:

    【解决方案2】:

    编辑了我上面的帖子以显示答案。

    找到了。

    这些似乎有帮助。

    -dontwarn **CompatHoneycomb
    -dontwarn **CompatCreatorHoneycombMR2
    -dontwarn android.support.v4.view.**
    -keep class android.support.v4.** { *; }
    
    -dontwarn java.awt.**,javax.security.**,java.beans.**,javax.xml.**,java.util.**,org.w3c.dom.**
    

    【讨论】:

    • 我已经迁移编辑回答现在你只需要接受它。
    【解决方案3】:

    将以下内容添加到您的 proguard 配置文件中。

    -keep class org.codehaus.jackson.** { 
        *; 
    }
    

    您无需隐藏 3rd 方库。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-05
      • 1970-01-01
      • 2012-09-16
      相关资源
      最近更新 更多