Eclipse中的ProGuard错误

时间:2012-08-01 07:33:57

标签: android eclipse proguard

我在Proguard.cfg进行了更改,并在导出应用时开始收到这些错误。

我正在使用Google GData YouTube API。我正在使用这些库:

activation.jar, additionnal.jar, crittercism_v2_1_7.jar, gdata-base-1.0.jar, gdata-client-1.0.jar, gdata-core-1.0.jar, gdata-media-1.0.jar, gdata-youtube-2.0.jar, guava-12.0.jar, GoogleAdMobAdsSdk-4.3.1.jar, mail.jar, json-simple-1.1.1.jar
当我在设备上调试我的应用程序时,

它正在工作

一切正常,直到我在proguard.cfg中添加以下行:

-dump proguard/class_files.txt 
-printseeds proguard/seeds.txt 
-printusage proguard/unused.txt 
-printmapping proguard/mapping.txt 

Ecplise控制台中的错误:请关注我的粘贴链接here

我的 proguard.cfg 文件:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-dump proguard/class_files.txt 
-printseeds proguard/seeds.txt 
-printusage proguard/unused.txt 
-printmapping proguard/mapping.txt 

-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 public class com.crittercism.**


-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 *;
}

-keepclassmembers public class com.crittercism.*
{
    *;
}

1 个答案:

答案 0 :(得分:0)

是的,我自己解决了。我做的是,只需在Proguard.cfg中添加以下行:

-dontwarn java.awt.**,javax.security.**,java.beans.**
-dontwarn javax.xml.stream.events.**
-dontwarn com.google.gdata.**, com.google.common.**

避免所有警告

谢谢,希望这有助于某人..