-1

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!

4

1 回答 1

0

配置文件中的最后一行指定-libraryjars不带预期参数的选项。在任何情况下,您都应该删除这一行,因为 Android 构建过程会自动为您指定必要的 -injars/-outjars/-libraryjars 选项。

请注意,Android SDK 的最新版本已弃用proguard.cfg,取而代之的是一个proguard-project.txt基本上为空的文件,其中大部分配置位于共享的内部配置文件中(全部在 中指定project.properties)。

于 2013-09-25T00:45:27.670 回答