ProGuard,我收到了错误

时间:2014-07-07 08:29:22

标签: android proguard

所以这是我第一次使用proguard,我尝试了几件事,在互联网上阅读,但我被困在这里,我可以使用一些帮助

我的libs文件夹中有罐子

这是proguard appname.txt文件:

 -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.preference.Preference
-keep public class * extends org.cmc.music.clean.NameRectifier.*
-keep public class * extends org.cmc.music.clean.NameRectifier
-keep public class * org.cmc.music.myid3.ID3v2DataMapping
-keep public class * org.cmc.music.myid3.ID3v2DataMapping.*
-keep public class org.cmc.music.*
-keep public class com.android.vending.billing.IInAppBillingService
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
}
-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.content.Context {
    public void *(android.view.View);
    public void *(android.view.MenuItem);
}
-libraryjars libs/android-support-v4.jar
-libraryjars libs/MyID3_for_Android.jar
-libraryjars libs/stackblur.jar

这是属性文件:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-PlayMee.txt

# Project target.
target=android-19
android.library.reference.1=../../Workspace-mine/libproject/google-play-services_lib

logcat的:

  [2014-07-07 14:07:48 - PlayMee] Proguard returned with error code 1. See console
[2014-07-07 14:07:48 - PlayMee] proguard.ParseException: Expecting opening '{' at 'org.cmc.music.myid3.ID3v2DataMapping' in line 9 of file 'D:\android\Workspace\PlayMee\proguard-PlayMee.txt',
[2014-07-07 14:07:48 - PlayMee]   included from argument number 4
[2014-07-07 14:07:48 - PlayMee]     at proguard.ConfigurationParser.parseClassSpecificationArguments(ConfigurationParser.java:678)
[2014-07-07 14:07:48 - PlayMee]     at proguard.ConfigurationParser.parseKeepClassSpecificationArguments(ConfigurationParser.java:490)
[2014-07-07 14:07:48 - PlayMee]     at proguard.ConfigurationParser.parse(ConfigurationParser.java:138)
[2014-07-07 14:07:48 - PlayMee]     at proguard.ProGuard.main(ProGuard.java:484)

1 个答案:

答案 0 :(得分:2)

如果你直接使用jar org.cmc.music.myid3.ID3v2DataMapping类, 在progaurd-config文件行中 -keep public class * org.cmc.music.myid3.ID3v2DataMapping 从中删除*并将其更改为 -keep public class org.cmc.music.myid3.ID3v2DataMapping 如果您要从org.cmc.music.myid3.ID3v2DataMapping扩展课程,请将同一行更改为-keep public class * extends org.cmc.music.myid3.ID3v2DataMapping

您还必须为下一行重复相同的步骤。