0

私のアプリケーションでは、proguard.config=proguard.cfg を project.properties に追加するために proguard を有効にしたいと考えています。

私のproguard.cfgには含まれています

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.slf4j.**
-dontwarn org.json.*
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }

-keepclasseswithmembernames class * {
    native <methods>; }

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet); }

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int); }

-keepclassmembers class * extends android.app.Activity {    public void *(android.view.View); }

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String); }

-keep class * implements android.os.Parcelable {   public static final android.os.Parcelable$Creator *; }

私のコンソール:

[2013-06-06 18:32:00 - Explosionfilters] Proguard returned with error code 1. See console
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.io.Buffer
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.Address
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields$Field
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.HttpRequestAdapter: can't find referenced class org.mortbay.jetty.HttpFields
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.jetty.JettyOAuthConsumer: can't find referenced class org.mortbay.jetty.client.HttpExchange
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-06-06 18:32:00 - Explosionfilters] Warning: oauth.signpost.signature.OAuthMessageSigner: can't find referenced class org.apache.commons.codec.binary.Base64
[2013-06-06 18:32:00 - Explosionfilters]       You should check if you need to specify additional program jars.
[2013-06-06 18:32:00 - Explosionfilters] Warning: there were 31 unresolved references to classes or interfaces.
[2013-06-06 18:32:00 - Explosionfilters]          You may need to specify additional library jars (using '-libraryjars').
[2013-06-06 18:32:00 - Explosionfilters] java.io.IOException: Please correct the above warnings first.
[2013-06-06 18:32:00 - Explosionfilters]    at proguard.Initializer.execute(Initializer.java:321)
[2013-06-06 18:32:00 - Explosionfilters]    at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-06-06 18:32:00 - Explosionfilters]    at proguard.ProGuard.execute(ProGuard.java:86)
[2013-06-06 18:32:00 - Explosionfilters]    at proguard.ProGuard.main(ProGuard.java:492)
    please help me how to solve this issue
4

2 に答える 2

1

proguard で twitter4j の設定を追加していません。以下の設定を追加する必要があります

-dontwarn javax.management.**
-dontwarn java.lang.management.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.slf4j.**
-dontwarn org.json.*

この:

-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }

これで問題が解決します

于 2013-06-06T12:45:20.333 に答える
0

同じエラーが発生しましたが、「proguard-android.txt」ファイルに次の行を追加することで問題が解決しました。

-dontwarn com.google.android.gms.**

-dontwarn org.mortbay.**
-dontwarn org.slf4j.**
-dontwarn org.apache.log4j.**
-dontwarn org.apache.commons.logging.**
-dontwarn org.apache.commons.codec.binary.**

-keep class twitter4j.** { *; }

Warning: com.google.android.gms.common.GooglePlayServicesUtil: can't find referenced class android.content.pm.PackageInstaller のような Google Play サービスの場合

これが解決策です!それがあなたにとってもうまくいくことを願っています!

于 2015-04-21T07:04:08.727 に答える