Android-proguard.cfg错误 [英] Android - proguard.cfg error
问题描述
在新计算机上安装了android SDK之后,我导入了一个较旧的项目.我在Eclipse的问题"窗口中遇到以下错误.
I imported an older project after a I installed the android SDK on a new computer. I am getting the following error in the "problems" window in eclipse.
Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /MyApplication line 1
这是文件.我尝试用-keepclasseswithmembers
替换此文件中的-keepclasseswithmembernames
,但没有帮助.
Here is the file. I tried replacing the -keepclasseswithmembernames
in this file with -keepclasseswithmembers
but it did not help.
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-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
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
推荐答案
这是我与proguard 4.4,JDK 1.6,目标android 2.1一起使用的示例配置文件.
双击jar文件或使用java -jar android-sdk/tools/proguard/lib/proguard.jar
(使用android sdk安装路径)来检查您的proguard版本
This is a sample config file that I use with proguard 4.4, JDK 1.6, target android 2.1.
Check your proguard version by double clicking on the jar file or with java -jar android-sdk/tools/proguard/lib/proguard.jar
(use android sdk install path)
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-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
-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 *;
}
这篇关于Android-proguard.cfg错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!