我第一次尝试使用 Proguard 4.9 导出我的应用程序。但是在导出时,我在控制台中遇到了奇怪的错误。这里是 -
[2013-06-11 14:59:42 - Project1] Proguard returned with error code 1. See console
[2013-06-11 14:59:42 - Project1] proguard.ParseException: Expecting type and name instead of just '***' before '(' in line 193 of file 'D:\Project Works\Android\Project1\bin\proguard.txt',
[2013-06-11 14:59:42 - Project1] included from argument number 4
[2013-06-11 14:59:42 - Project1] at proguard.ConfigurationParser.parseMemberSpecificationArguments(ConfigurationParser.java:889)
[2013-06-11 14:59:42 - Project1] at proguard.ConfigurationParser.parseClassSpecificationArguments(ConfigurationParser.java:729)
[2013-06-11 14:59:42 - Project1] at proguard.ConfigurationParser.parseKeepClassSpecificationArguments(ConfigurationParser.java:516)
[2013-06-11 14:59:42 - Project1] at proguard.ConfigurationParser.parse(ConfigurationParser.java:165)
[2013-06-11 14:59:42 - Project1] at proguard.ProGuard.main(ProGuard.java:476)
这是第 192 行和第 193 行的 bin\proguard.txt 文件,错误来了
# onClick res/layout/tmenu.xml #generated:77
-keepclassmembers class * { *** (...); }
在我正在使用的 project.properties
target=android-7
proguard.config=proguard.cfg
我是 Android SDK 和 eclipse 的插件更新到最新。知道如何解决吗???
编辑 这是我项目中的 proguard.cfg
-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 *;
}