23

私は常に次のエラーでProGuardを使用します:

[2012-05-19 17:50:13 - xxx] Warning: there were 13 unresolved references to      program class members.
[2012-05-19 17:50:13 - xxx]          Your input classes appear to be     inconsistent.
[2012-05-19 17:50:13 - xxx]          You may need to recompile them and try again.
[2012-05-19 17:50:13 - xxx]          Alternatively, you may have to specify the option 
[2012-05-19 17:50:13 - xxx]          '-dontskipnonpubliclibraryclassmembers'.
[2012-05-19 17:50:13 - xxx] Error: Please correct the above warnings first.
[2012-05-19 17:55:40 - xxx] Proguard returned with error code 1. See console
[2012-05-19 17:55:40 - xxx] Note: there were 239 duplicate class definitions.
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.FormBodyPart:    can't find superclass or interface org.apache.james.mime4j.message.BodyPart
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.HttpMultipart: can't find superclass or interface org.apache.james.mime4j.message.Multipart
[2012-05-19 17:55:40 - xxx] Warning: org.apache.http.entity.mime.MinimalField: can't find superclass or interface org.apache.james.mime4j.parser.Field

私のproguard.cfgファイルは次のとおりです。

-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }

-keepattributes *Annotation*
-keepattributes SourceFile, LineNumberTable

-libraryjars /libs/crittercism_v2_0_1.jar
-libraryjars /libs/dropbox-android-sdk-1.2.2.jar
-libraryjars /libs/FlurryAgent.jar
-libraryjars /libs/httpmime-4.0.3.jar
-libraryjars /libs/json_simple-1.1.jar

すでにすべての外部ライブラリを追加しているのに、なぜこれらのエラーが常に発生するのですか?誰か助けてもらえますか?

編集21.05.2012: 問題は、「Dropbox」jarと「ActionBarSherlock」を追加した場合です。「Dropbox」だけ追加すれば問題ありません。「ActionBarSherlock」だけを追加すれば問題ありません。しかし、両方を追加すると、上記のエラーが発生します。

4

2 に答える 2

39

プロジェクトに「ActionBarSherlock」および「DropBox」jarを追加した場合、問題が発生します。この問題を解決するには、proguard-project.txtファイルに次の行を追加します。

-dontwarn org.apache.**

警告は無視され、各jarのみが機能しているため機能します。したがって、両方を追加すると、これがProGuardのバグになると思います。

于 2012-05-21T08:10:03.443 に答える
10

おそらくあなたはする必要があります:

-クラスorg.apache.http。**を保持します

-インターフェースorg.apache.http。**を保持します

もちろん、ProGuardがapacheクラスについて不平を言っていることを前提としています。確かに、私はProGuardの専門家ではないので、多少推測しています。

于 2012-05-19T16:15:20.807 に答える