I just started using proguard, and used a file found on this site as my proguard.cfg file:
-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 ; }-keepclasseswithmembers class * {
public (android.content.Context, android.util.AttributeSet); }-keepclasseswithmembers class * {
public (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 *; }
when I get to the final step of a signed apk export using eclipse, I get the error:
Proguard returned with error code 1. See console
The console states this:
Proguard returned with error code 1. See console [2012-12-27 14:23:16
– FlashActivity] java.io.FileNotFoundException: C:\Users\Liam\workspace\FlashActivity\bin\proguard.txt (The system
cannot find the file specified) [2012-12-27 14:23:16 – FlashActivity]
at java.io.FileInputStream.open(Native Method) [2012-12-27 14:23:16 –
FlashActivity] at java.io.FileInputStream.(Unknown Source)
[2012-12-27 14:23:16 – FlashActivity] at
java.io.FileReader.(Unknown Source) [2012-12-27 14:23:16 –
FlashActivity] at
proguard.FileWordReader.(FileWordReader.java:39) [2012-12-27
14:23:16 – FlashActivity] at
proguard.ConfigurationParser.parseIncludeArgument(ConfigurationParser.java:217)
[2012-12-27 14:23:16 – FlashActivity] at
proguard.ConfigurationParser.parse(ConfigurationParser.java:124)
[2012-12-27 14:23:16 – FlashActivity] at
proguard.ProGuard.main(ProGuard.java:484)
Judging by the output, I would say that there is supposed to be a proguard.txt file in my apps bin folder, and there isn’t one.
What should this file contain if I make it?
You should update your Android SDK with the interactive
androidtool and then also update your project withThis should create
proguard-project.txtand updateproject.propertiesto point to this file.