我在Android應用程序上使用Proguard時出現以下錯誤。
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$2: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$3: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$4: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$5: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$6: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$7: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$8: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$9: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanMap$Entry: can't find superclass or interface org.apache.commons.collections.keyvalue.AbstractMapEntry
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanPredicate: can't find superclass or interface org.apache.commons.collections.Predicate
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanPropertyValueChangeClosure: can't find superclass or interface org.apache.commons.collections.Closure
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanPropertyValueEqualsPredicate: can't find superclass or interface org.apache.commons.collections.Predicate
ProGuard: [sand] Warning: org.apache.commons.beanutils.BeanToPropertyValueTransformer: can't find superclass or interface org.apache.commons.collections.Transformer
ProGuard: [sand] Warning: org.apache.commons.beanutils.MappedPropertyDescriptor: can't find superclass or interface java.beans.PropertyDescriptor
ProGuard: [sand] Warning: org.apache.commons.logging.impl.ServletContextCleaner: can't find superclass or interface javax.servlet.ServletContextListener
ProGuard: [sand] Warning: roboguice.activity.RoboMapActivity: can't find superclass or interface com.google.android.maps.MapActivity
ProGuard: [sand] Warning: roboguice.test.shadow.ShadowFragmentActivity: can't find superclass or interface com.xtremelabs.robolectric.shadows.ShadowActivity
ProGuard: [sand] Warning: library class org.apache.http.auth.AuthenticationException extends or implements program class org.apache.http.ProtocolException
ProGuard: [sand] Warning: library class org.apache.http.auth.MalformedChallengeException extends or implements program class org.apache.http.ProtocolException
ProGuard: [sand] Warning: library class org.apache.http.auth.params.AuthParamBean extends or implements program class org.apache.http.params.HttpAbstractParamBean
... keeps going till 743 errors (warnings)
我試過幾個選項,以防止這種情況的發生(-dontskipnonpubliclibraryclassmembers,-keep,-dontwarn,-ignorewarnings)沒有成功。也許我沒有正確使用這些選項。我正在使用IntelliJ並針對Android-19(Android 4.4.2)。
該應用程序使用一些第三方庫進行構建:其中一些包含在libs文件夾中,其他一些包含在Maven pom.xml中。我懷疑通過pom.xml包含的庫不包含在-libraryjars選項中。
我project.properties看起來是這樣的:
# 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-optimize.txt:proguard-project.txt
# Project target.
target=android-19
我proguard的-project.txt看起來是這樣的:
-dontskipnonpubliclibraryclassmembers
# Libraries
-dontwarn org.apache.**
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
# WebView with JS: specify the fully qualified class name to the JavaScript interface class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
# Database model
-keep class com.mycompany.model.db.**
-keepclassmembers class com.mycompany.model.db.** { *; }
# Project target.
target=android-19
任何想法,爲什麼發生這種情況?