Proguard return with error code 1 proguard.ParseException

最后都变了- 提交于 2019-12-12 06:58:00

问题


I tried to export my android project to apk, and while building i got this error on Console, i cycled through google, but I didn't find any error like this:

[2013-09-24 18:09:42 - Google] Proguard returned with error code 1. See console
[2013-09-24 18:09:42 - Google] proguard.ParseException: Expecting jar or directory name    before '-include' in argument number 3
[2013-09-24 18:09:42 - Google]  at proguard.ConfigurationParser.readNextWord(ConfigurationParser.java:1133)
[2013-09-24 18:09:42 - Google]  at proguard.ConfigurationParser.parseClassPathArgument(ConfigurationParser.java:249)
[2013-09-24 18:09:42 - Google]  at proguard.ConfigurationParser.parse(ConfigurationParser.java:130)
[2013-09-24 18:09:42 - Google]  at proguard.ProGuard.main(ProGuard.java:484)

And this is 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 <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 *;
}

-dontskipnonpubliclibraryclassmembers
-libraryjars

Any help would be appreciate!


回答1:


The last line in your configuration file specifies the option -libraryjars without the expected argument. In any case, you should remove this line, since the Android build process automatically specifies the necessary -injars/-outjars/-libraryjars options for you.

Note that recent versions of the Android SDK have deprecated proguard.cfg in favor of a file proguard-project.txt that is essentially empty, with the bulk of the configuration in a shared internal configuration file (all specified in project.properties).



来源:https://stackoverflow.com/questions/18987105/proguard-return-with-error-code-1-proguard-parseexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!