0

I've searched around here for how to solve this, and nothing I found has helped. I suspected the solution would have been in here, but I was wrong. I'm not getting anything in the console when I have verbose enabled, so this is difficult to pin down. I can export other projects with proguard enabled just fine, but not this particular project. Originally, I thought it had something to do with the opencsv jar I am using, but I removed that jar, and removed the references to it in code, and I still got the error.

Exporting the app without proguard works, and the app itself runs fine.

Note: The AlternateJavaBridgelib stuff is a library I used with most of my projects. I have no issue exporting apks with proguard in those other apps (which is why I though it may have been the opencsv jar, it's the only other jar that I'm NOT using in the other apps).

Here's my proguard.cfg in case I'm missing something:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable


-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
-keep public class au.com.bytecode.**
-keep public class java.beans.**

-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 *;
}

-keep class * implements java.io.Serializable {
    static final long serialVersionUID;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    public boolean equals(java.lang.Object);    
}


-dontwarn java.beans.**, android.support.v4.**, com.google.ads.**, android.provider.CalendarContract*, com.dropbox.client2.**,
android.view.Display, com.xiledsystems.AlternateJavaBridgelib.components.altbridge.FormFragment, android.widget.Switch, au.com.bytecode.opencsv.**

EDIT: It seems like proguard actually works. It seems to be failing after proguard runs for some reason. I get a dump, mapping, seeds, and usage txt files generated for the project.

Community
  • 1
  • 1
Ryan
  • 937
  • 1
  • 10
  • 17

1 Answers1

1

This may be a bug in ProGuard, producing invalid code, on which dx then reports the obscure error. Make sure you are using the latest version of ProGuard. If the problem persists, you can report it on the ProGuard site, or perhaps mail me a project that allows me to reproduce the problem.

(I am he developer of ProGuard)

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • Thanks Eric, that fixed it. I thought I had upgraded at an earlier point, but apparently I had not. I can now export the app with proguard enabled. – Ryan Nov 13 '12 at 20:12
  • I found out what caused this issue. I had canceled an export as it was processing. Once you do this, it seems to bork proguard. I did the same thing this time, and I had to delete the project, and re-import it to the workspace to get it to work. Hopefully this info will help you to find the problem. – Ryan Nov 26 '12 at 17:24