你好,我正在编写一个应用程序,使用了兼容性库,并在应用中使用了视图分页器。同时我还使用了一个操作栏库,我从这个链接获取了该库。
然而,当我运行编译和签名我的应用程序时,出现一个对话框,上面写着“Proguard返回错误代码1。请参阅控制台。”
因此,我查看了我的控制台,上面写着以下内容。
但是对我来说这并没有太多意义,我不知道该怎么做才能让它工作?有什么想法吗?我之前在一个没有使用兼容库的应用程序上使用过那个proguard脚本,但是,我从那个脚本中得到的信息说它应该与兼容库一起使用,但实际上并没有?有人有任何想法吗?非常感谢。
===编辑===
从我的构建路径中删除空格后,我能够进展一点,但仍然失败了,出现错误1,控制台现在有一个新的错误列表,看起来像这样。
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)
但是对我来说这并没有太多意义,我不知道该怎么做才能让它工作?有什么想法吗?我之前在一个没有使用兼容库的应用程序上使用过那个proguard脚本,但是,我从那个脚本中得到的信息说它应该与兼容库一起使用,但实际上并没有?有人有任何想法吗?非常感谢。
===编辑===
从我的构建路径中删除空格后,我能够进展一点,但仍然失败了,出现错误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)