26

I am having the following error on proguard.cfg file in my android project. I dont know what this error says. Any idea?

Khawar Raza
  • 15,870
  • 24
  • 70
  • 127

2 Answers2

27

This is a bug with the SDK tools v11. http://code.google.com/p/android/issues/detail?id=16384

When Lint generates error,

  • go to lint warnings view (Window > Show View > Other > android > Lint Warnings) and double click the error to modify proguard.cfg

  • rename "keepclasseswithmembernames" to "keepclasseswithmembers" on line it shows error and save.

  • run Lint again (click refresh in Lint Warnings view)

  • repeat renaming if it shows further warnings in subsequent lines.

I changed mine to look like this.

-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 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 enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}
Himanshu Likhyani
  • 4,490
  • 1
  • 33
  • 33
16

Try with

Clean and build your project then select the error marker in the Problems view and press Delete.

see the following link

http://groups.google.com/group/android-developers/browse_thread/thread/7606320e664fec9b

Sunil Kumar Sahoo
  • 53,011
  • 55
  • 178
  • 243
  • 2
    This just clears the error. However, if you have anything that relies on that obfuscation it will break. The other answer is correct. – Martin May 14 '12 at 23:37