你好,我正在编写一个使用兼容性库的应用程序,我在应用程序中使用了一个视图寻呼机。我还使用了一个操作栏库,这是我从这个链接中获得的。
https://github.com/johannilsson/android-actionbar
我的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
#keep all classes that might be used in XML layouts
-keep public class * extends android.view.View
-keep public class * extends android.app.Fragment
-keep public class * extends android.support.v4.Fragment
#keep all public and protected methods that could be used by java reflection
-keepclassmembernames class * {
public protected <methods>;
}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-dontwarn **CompatHoneycomb
-dontwarn org.htmlcleaner.*然后我的defualt.properties看起来像这样
# 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 use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
android.library.reference.1=../android-actionbar/actionbar
proguard.config=proguard.cfg然而,当我运行编译和签署我的应用程序时,我会得到一个对话框,上面写着"Proguard返回错误代码1。请参阅控制台“。
因此,我看一下我的控制台,它读到了以下内容
[2011-11-01 01:48:39 - Test App] Proguard returned with error code 1. See console
[2011-11-01 01:48:39 - Test App] proguard.ParseException: Unknown option 'Manager' in argument number 9
[2011-11-01 01:48:39 - Test App] at proguard.ConfigurationParser.parse(ConfigurationParser.java:170)
[2011-11-01 01:48:39 - Test App] at proguard.ProGuard.main(ProGuard.java:491)但这对我来说并不意味着什么,我也不知道该怎么做才能让这件事奏效?我以前在一个不使用兼容性库的应用程序上使用过这个脚本,但是,我从哪里得到的那个脚本说它应该与兼容性库一起工作,但它不能?任何有想法的人都会非常感激的
===EDIT===
在从构建路径中删除空格之后,我能够走得更远一些,但由于错误1仍然失败,控制台现在有了一个新的错误列表,如下所示。
[2011-11-01 14:01:20 - TestApp] Proguard returned with error code 1. See console
[2011-11-01 14:01:20 - TestApp] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find superclass or interface android.os.Parcelable$ClassLoaderCreator
[2011-11-01 14:01:20 - TestApp] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find referenced class android.os.Parcelable$ClassLoaderCreator
[2011-11-01 14:01:20 - TestApp] Warning: android.support.v4.os.ParcelableCompatCreatorHoneycombMR2: can't find referenced class android.os.Parcelable$ClassLoaderCreator
[2011-11-01 14:01:20 - TestApp] Warning: there were 3 unresolved references to classes or interfaces.
[2011-11-01 14:01:20 - TestApp] You may need to specify additional library jars (using '-libraryjars'),
[2011-11-01 14:01:20 - TestApp] or perhaps the '-dontskipnonpubliclibraryclasses' option.
[2011-11-01 14:01:20 - TestApp] java.io.IOException: Please correct the above warnings first.
[2011-11-01 14:01:20 - TestApp] at proguard.Initializer.execute(Initializer.java:308)
[2011-11-01 14:01:20 - TestApp] at proguard.ProGuard.initialize(ProGuard.java:210)
[2011-11-01 14:01:20 - TestApp] at proguard.ProGuard.execute(ProGuard.java:85)
[2011-11-01 14:01:20 - TestApp] at proguard.ProGuard.main(ProGuard.java:499)发布于 2011-11-01 15:00:53
我猜您的项目路径包含空格(在本例中是word Manager)。最新的(ADT R14)仍然存在将包含空格的路径传递给ProGuard的问题。替代工作-周旋:
发布于 2011-11-01 15:14:06
这可能不算什么,但当我遇到这个问题时,我所做的是:
Eclipse
中的新project
我不知道以前的项目不起作用,但我所知道的是,这个技巧对我有效。我希望它能帮上忙
https://stackoverflow.com/questions/7962926
复制相似问题