Android - proguard.cfg error

I imported the old project after I installed the Android SDK on a new computer. I get the following error in the "problems" window in eclipse.

Obsolete proguard file; use -keepclasseswithmembers instead of -keepclasseswithmembernames proguard.cfg /MyApplication line 1 

Here is the file. I tried replacing -keepclasseswithmembernames in this file with -keepclasseswithmembers , but that 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); } 
+1
source share
6 answers

This is an example configuration file that I use with proguard 4.4, JDK 1.6, target Android 2.1. Check the version of proguard by double-clicking the jar file or using java -jar android-sdk/tools/proguard/lib/proguard.jar (use the installation path of sroid sdk)

 -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 *; } 
+2
source

This seems to be an Eclipse / Android SDK bug I suggest

1) close the project gives you an error 2) remove it from the eclipse (do not delete the folder or source) 3) import the project that you deleted 4) clean and build again

Regards Stefano

+2
source

if Previous answer didn't help

Then just create an empty Android project in Eclipse and copy / replace the created file โ€œproguard.cfgโ€ into your project.

+1
source

It helps me; Right-click the project name and click "Android Project". Then select "Clear Lint Markers." It seems that I accidentally ran Lint to check for some common problems, after which I started to see these proguard.cfg errors. It's funny that although I was going into debug mode, eclipse would still complain about proguard (which is supposed to be used when compiling only in release mode).

0
source

proguard.cfg will be at the root of your project. edit it by replacing:

 -keepclasseswithmembernames class * { 

with

 -keepclasseswithmembers class * { 

I worked with the launch of the ADT package (v21.0.0-531062 with eclipse 3.7.2 using JDK1.7 under windowsxp).

0
source

An error was selected in the eclipse problems window. and it works for me.

0
source

Source: https://habr.com/ru/post/1480794/


All Articles