アプリのリリース バージョンを作成した後、ProGuard を使用することにしました。project.properties ファイルに以下を追加しました。
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt
リリース バージョンをビルドしようとすると、次のエラーが発生します。
[2012-11-28 17:47:37 - MyApp] Proguard returned with error code 1. See console
[2012-11-28 17:47:37 - MyApp] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2012-11-28 17:47:37 - MyApp] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2012-11-28 17:47:37 - MyApp] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2012-11-28 17:47:37 - MyApp] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2012-11-28 17:47:37 - MyApp] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2012-11-28 17:47:37 - MyApp] Warning: there were 5 unresolved references to classes or interfaces.
[2012-11-28 17:47:37 - MyApp] You may need to specify additional library jars (using '-libraryjars').
[2012-11-28 17:47:37 - MyApp] java.io.IOException: Please correct the above warnings first.
[2012-11-28 17:47:37 - MyApp] at proguard.Initializer.execute(Initializer.java:321)
[2012-11-28 17:47:37 - MyApp] at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-11-28 17:47:37 - MyApp] at proguard.ProGuard.execute(ProGuard.java:86)
[2012-11-28 17:47:37 - MyApp] at proguard.ProGuard.main(ProGuard.java:492)
これは、私が使用している道しるべライブラリを明確に参照しています。必要な jar とライブラリを正しく追加したと思いますが、そうではないのでしょうか?
「外部 JAR を追加...」ボタンを使用して標識 jar を追加し、「外部クラス フォルダーを追加...」ボタンを使用して commons-codec ライブラリを追加しました。
ここで何が間違っていますか?
アップデート:
プロジェクトのルートに proguard-project.txt というファイルを追加しました。
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
proguard-project.txt ファイル内に、次を追加しました。
-keep class org.apache.** { *; }
-keep class oauth.signpost.** { *; }
私はまだ同じエラーを受け取ります。