我最近安装了ADT 16,现在突出显示了一个问题,即我有一个过时的选项-keepclasseswithmembernames而不是-keepclasseswithnames.我已经修复了proguard.cfg文件,但lint拒绝识别修复程序并阻止Eclipse构建文件.
我目前的proguard.cfg文件:
-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
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
解决方法:
在Lint警告窗口中,选择警告并单击“忽略类型按钮”(右上角,看起来像橡皮擦或其他东西).
之后,转到http://b.android.com并提交错误.
更新:ADT无法刷新非Java和非XML文件,以下是该问题的链接:
http://code.google.com/p/android/issues/detail?id=23196
如新的答案所示,单击“刷新”将清除错误.