问题描述
一直缠斗使用ProGuard了一整天,已经尝试了许多例子和解决方案在官方网站Proguard的以及计算器。
我有一个大的项目,我需要进行模糊处理,里面有多个引用的库项目和罐子。
我收到来自ProGuard的725的警告2库,com.google.common和twitter4j。
我可以高兴地拿到项目进行编译,如果我添加以下内容:
-dontwarn com.google.common。**
-dontwarn twitter4j。*
然而,应用程序立即崩溃开放的,所以这似乎只是隐藏的问题,而不是修复它的一种方式。
ProGuard的-project.txt是在项目的根和它的配置是在project.properties文件如下图所示。
proguard.config = $ {sdk.dir} /tools/proguard/proguard-android.txt:proguard-project.txt
下面是我的ProGuard-project.txt文件
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dont preverify
-verbose
-dontshrink
-optimizations!code /简/算术,!现场/ * ,!类/合并/ *
-keep公共类*扩展android.app.Activity
-keep公共类*扩展android.app.Application
-keep公共类*扩展android.app.Service
-keep公共类*扩展android.content.BroadcastReceiver
-keep公共类*扩展android.content.ContentProvider
-keep公共类*扩展android.app.backup.BackupAgentHelper
-keep公共类*扩展的Android。preference。preference
-keep公共类com.android.vending.licensing.ILicensingService
-keep类的javax ** {*。 }
-keep类组织** {*。 }
-keep类twitter4j ** {*。 }
-keep类com.google code ** {*。; }
-keep类java.lang.management ** {*。 }
-keep类com.google.common ** {*。 }
-libraryjars C:/adt-bundle-windows/sdk/platforms/android-19/android.jar
-libraryjars C:/adt-bundle-windows/sdk/extras/android/support/v4/android-support-v4.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/commons-$c$cc.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/sqlcipher.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/twitter4j-core-3.0.3.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/guava-r09.jar
-libraryjars C:/adt-bundle-windows/sdk/platforms/android-19/android.jar
-libraryjars C:/adt-bundle-windows/sdk/extras/android/support/v4/android-support-v4.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/maps.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/effects.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/usb.jar
-keep公共类*扩展android.view.View {
公共和LT; INIT>(android.content.Context);
公共和LT; INIT>(android.content.Context,android.util.AttributeSet);
公共和LT; INIT>(android.content.Context,android.util.AttributeSet,INT);
公共无效套*(......);
}
-keepclasseswithmembers类* {
公共和LT; INIT>(android.content.Context,android.util.AttributeSet);
}
-keepclasseswithmembers类* {
公共和LT; INIT>(android.content.Context,android.util.AttributeSet,INT);
}
-keepclassmembers类*扩展android.content.Context {
公共无效*(android.view.View);
公共无效*(android.view.MenuItem);
}
-keepclassmembers类*实现android.os.Parcelable {
静态** CREATOR;
}
-keepclassmembers类** R $ * {
公共静态<领域取代;
}
-keepclassmembers类* {
@ android.webkit.JavascriptInterface<方法&GT ;;
}
-dontwarn android.support。**
这里是截断错误日志
[2014年1月13日14点零零分07秒 - 的MyApp] Proguard的返回错误code 1.见控制台
[二○一四年一月十三日14点〇〇分07秒 - 的MyApp]注:有9032重复的类定义。
[二〇一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.management.APIStatisticsOpenMBean:无法找到父类或接口javax.management.DynamicMBean中
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalence:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalence:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalence:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 1:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 1:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 1:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 2:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 2:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Equivalences $默认地将Impl $ 2:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Function:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Function:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Functions:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Functions:找不到引用的类javax.annotation.Nullable
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:com.google.common.base.Functions $ ConstantFunction:找不到引用的类javax.annotation.Nullable
*********************************** com.google.common误差的另外500线路***** *************************************
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类java.lang.management.ManagementFactory
[二〇一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.ObjectName中
[二〇一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.ObjectName中
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用javax.management.MBeanServer中的类
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.InstanceAlreadyExistsException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.InstanceAlreadyExistsException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.InstanceAlreadyExistsException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MBeanRegistrationException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MBeanRegistrationException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MBeanRegistrationException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.NotCompliantMBeanException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.NotCompliantMBeanException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.NotCompliantMBeanException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MalformedObjectNameException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MalformedObjectNameException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MalformedObjectNameException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类java.lang.management.ManagementFactory
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用javax.management.MBeanServer中的类
[二〇一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.ObjectName中
[二〇一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.ObjectName中
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用javax.management.MBeanServer中的类
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.InstanceAlreadyExistsException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MBeanRegistrationException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.NotCompliantMBeanException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.TwitterAPIMonitor:找不到引用的类javax.management.MalformedObjectNameException
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.CommonsLoggingLoggerFactory:找不到引用的类org.apache.commons.logging.LogFactory
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.CommonsLoggingLoggerFactory:找不到引用的类org.apache.commons.logging.LogFactory
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Level
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Level
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLogger:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLoggerFactory:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.Log4JLoggerFactory:找不到引用的类org.apache.log4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLogger:找不到引用的类org.slf4j.Logger
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLoggerFactory:找不到引用的类org.slf4j.LoggerFactory
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.internal.logging.SLF4JLoggerFactory:找不到引用的类org.slf4j.LoggerFactory
[二○一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.management.APIStatisticsOpenMBean:找不到引用的类javax.management.openmbean.CompositeType中
[二○一四年一月十三日14点〇〇分07秒 - 的MyApp]警告:twitter4j.management.APIStatisticsOpenMBean:找不到引用的类javax.management.openmbean.CompositeType中
*********************************** twitter4j误差的另外500线路********* *********************************
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]您应该检查是否需要指定其他程序罐子。
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]警告:有725未解析引用的类或接口。
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]你可能需要指定其他的jar包(用-libraryjars)。
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp] java.io.IOException异常:请首先纠正上述警告。
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]在proguard.Initializer.execute(Initializer.java:321)
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]在proguard.ProGuard.initialize(ProGuard.java:211)
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]在proguard.ProGuard.execute(ProGuard.java:86)
[二○一四年一月一十三日14点〇〇分07秒 - 的MyApp]在proguard.ProGuard.main(ProGuard.java:492)
从崩溃
编辑**堆栈跟踪,更清晰的现在,它链接到sqlcipher
E /数据库(18203):找不到SQLiteDatabase.mNativeHandle
E /光标(18203):找不到网/ sqlcipher /数据库/ SQLiteCompiledSql
E /光标(18203):找不到网/ sqlcipher /数据库/ SQLiteQuery
E /光标(18203):找不到网/ sqlcipher /数据库/ SQLiteProgram
E /光标(18203):找不到网/ sqlcipher /数据库/ SQLiteStatement
E / CursorWindow(18203):找不到网/ sqlcipher / CursorWindow
D / AndroidRuntime(18203):关闭虚拟机
W / dalvikvm(18203):主题ID = 1:螺纹退出与未捕获的异常(组= 0x415e9ba8)
E / AndroidRuntime(18203):致命异常:主要
E / AndroidRuntime(18203):工艺:com.mycompany.android.myapp,PID:18203
E / AndroidRuntime(18203):java.lang.NoClassDefFoundError的:网/ sqlcipher / CursorWindow
E / AndroidRuntime(18203):在java.lang.Runtime.nativeLoad(本机方法)
E / AndroidRuntime(18203):在java.lang.Runtime.doLoad(Runtime.java:421)
E / AndroidRuntime(18203):在java.lang.Runtime.loadLibrary(Runtime.java:362)
E / AndroidRuntime(18203):在java.lang.System.loadLibrary(System.java:526)
E / AndroidRuntime(18203):在net.sqlcipher.database.SQLiteDatabase.a(来源不明)
E / AndroidRuntime(18203):在net.sqlcipher.database.SQLiteDatabase.a(来源不明)
E / AndroidRuntime(18203):在com.mycompany.android.myapplib.sqlite.MyProvider.onCreate(来源不明)
E / AndroidRuntime(18203):在android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
E / AndroidRuntime(18203):在android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
E / AndroidRuntime(18203):在android.app.ActivityThread.installProvider(ActivityThread.java:4790)
E / AndroidRuntime(18203):在android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
E / AndroidRuntime(18203):在android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
E / AndroidRuntime(18203):在android.app.ActivityThread.access $ 1500(ActivityThread.java:135)
E / AndroidRuntime(18203):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1256)
E / AndroidRuntime(18203):在android.os.Handler.dispatchMessage(Handler.java:102)
E / AndroidRuntime(18203):在android.os.Looper.loop(Looper.java:136)
E / AndroidRuntime(18203):在android.app.ActivityThread.main(ActivityThread.java:5017)
E / AndroidRuntime(18203):在java.lang.reflect.Method.invokeNative(本机方法)
E / AndroidRuntime(18203):在java.lang.reflect.Method.invoke(Method.java:515)
E / AndroidRuntime(18203):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:779)
E / AndroidRuntime(18203):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E / AndroidRuntime(18203):在dalvik.system.NativeStart.main(本机方法)
E / AndroidRuntime(18203):java.lang.NoClassDefFoundError的:产生的原因NET / sqlcipher /数据库/ SQLiteStatement
E / AndroidRuntime(18203):22 ...更多
E / AndroidRuntime(18203):java.lang.NoClassDefFoundError的:产生的原因NET / sqlcipher /数据库/ SQLiteProgram
E / AndroidRuntime(18203):22 ...更多
E / AndroidRuntime(18203):java.lang.NoClassDefFoundError的:网/ sqlcipher /数据库/ SQLiteQuery所致
E / AndroidRuntime(18203):22 ...更多
E / AndroidRuntime(18203):java.lang.NoClassDefFoundError的:网/ sqlcipher /数据库/ SQLiteCompiledSql所致
E / AndroidRuntime(18203):22 ...更多
E / AndroidRuntime(18203):由:java.lang.NoSuchFieldError:与名称的字段='mNativeHandle'签名='我'在课堂LNET / sqlcipher /数据库/ SQLiteDatabase;
E / AndroidRuntime(18203):22 ...更多
这些都是我用过去的SQLcipher的配置
-keep公共类net.sqlcipher。** {
*;
}
-keep公共类net.sqlcipher.database。** {
*;
}
Have been battling with Proguard all day and have tried many examples and solutions on the official Proguard site as well as StackOverflow.
I have a large project I need to obfuscate, which has a number of referenced library projects and Jars.
I am getting 725 warnings from proguard from 2 libs, com.google.common and twitter4j.
I can happily get the project to compile if I add the following:
-dontwarn com.google.common.**
-dontwarn twitter4j.**
However, the app crashes instantly on open, so this seems to just be a way of hiding an issue, not fixing it.
The proguard-project.txt is in the project root and its config is in the project.properties file as below.
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
Here is my proguard-project.txt file
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-dontshrink
-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 class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }
-keep class com.google.code.** { *; }
-keep class java.lang.management.** { *; }
-keep class com.google.common.** { *; }
-libraryjars C:/adt-bundle-windows/sdk/platforms/android-19/android.jar
-libraryjars C:/adt-bundle-windows/sdk/extras/android/support/v4/android-support-v4.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/commons-codec.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/sqlcipher.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/twitter4j-core-3.0.3.jar
-libraryjars C:/svn/android/MyAppLib/trunk/libs/guava-r09.jar
-libraryjars C:/adt-bundle-windows/sdk/platforms/android-19/android.jar
-libraryjars C:/adt-bundle-windows/sdk/extras/android/support/v4/android-support-v4.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/maps.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/effects.jar
-libraryjars C:/adt-bundle-windows/sdk/add-ons/addon-google_apis-google-19/libs/usb.jar
-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);
public void set*(...);
}
-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);
}
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-dontwarn android.support.**
And Here is the truncated error log
[2014-01-13 14:00:07 - MyApp] Proguard returned with error code 1. See console
[2014-01-13 14:00:07 - MyApp] Note: there were 9032 duplicate class definitions.
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find superclass or interface javax.management.DynamicMBean
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Equivalences$Impl$2: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Function: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Function: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Functions: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Functions: can't find referenced class javax.annotation.Nullable
[2014-01-13 14:00:07 - MyApp] Warning: com.google.common.base.Functions$ConstantFunction: can't find referenced class javax.annotation.Nullable
*********************************** ANOTHER 500 LINES OF com.google.common ERRORS ******************************************
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class java.lang.management.ManagementFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class java.lang.management.ManagementFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.ObjectName
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanServer
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.InstanceAlreadyExistsException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MBeanRegistrationException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.NotCompliantMBeanException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.TwitterAPIMonitor: can't find referenced class javax.management.MalformedObjectNameException
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.CommonsLoggingLoggerFactory: can't find referenced class org.apache.commons.logging.LogFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Level
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLogger: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.Log4JLoggerFactory: can't find referenced class org.apache.log4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLogger: can't find referenced class org.slf4j.Logger
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.internal.logging.SLF4JLoggerFactory: can't find referenced class org.slf4j.LoggerFactory
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeType
[2014-01-13 14:00:07 - MyApp] Warning: twitter4j.management.APIStatisticsOpenMBean: can't find referenced class javax.management.openmbean.CompositeType
*********************************** ANOTHER 500 LINES OF twitter4j ERRORS ******************************************
[2014-01-13 14:00:07 - MyApp] You should check if you need to specify additional program jars.
[2014-01-13 14:00:07 - MyApp] Warning: there were 725 unresolved references to classes or interfaces.
[2014-01-13 14:00:07 - MyApp] You may need to specify additional library jars (using '-libraryjars').
[2014-01-13 14:00:07 - MyApp] java.io.IOException: Please correct the above warnings first.
[2014-01-13 14:00:07 - MyApp] at proguard.Initializer.execute(Initializer.java:321)
[2014-01-13 14:00:07 - MyApp] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-01-13 14:00:07 - MyApp] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-01-13 14:00:07 - MyApp] at proguard.ProGuard.main(ProGuard.java:492)
EDIT** Stack trace from crash, clearer now that it is linked to sqlcipher
E/Database(18203): Can't find SQLiteDatabase.mNativeHandle
E/Cursor(18203): Can't find net/sqlcipher/database/SQLiteCompiledSql
E/Cursor(18203): Can't find net/sqlcipher/database/SQLiteQuery
E/Cursor(18203): Can't find net/sqlcipher/database/SQLiteProgram
E/Cursor(18203): Can't find net/sqlcipher/database/SQLiteStatement
E/CursorWindow(18203): Can't find net/sqlcipher/CursorWindow
D/AndroidRuntime(18203): Shutting down VM
W/dalvikvm(18203): threadid=1: thread exiting with uncaught exception (group=0x415e9ba8)
E/AndroidRuntime(18203): FATAL EXCEPTION: main
E/AndroidRuntime(18203): Process: com.mycompany.android.myapp, PID: 18203
E/AndroidRuntime(18203): java.lang.NoClassDefFoundError: net/sqlcipher/CursorWindow
E/AndroidRuntime(18203): at java.lang.Runtime.nativeLoad(Native Method)
E/AndroidRuntime(18203): at java.lang.Runtime.doLoad(Runtime.java:421)
E/AndroidRuntime(18203): at java.lang.Runtime.loadLibrary(Runtime.java:362)
E/AndroidRuntime(18203): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime(18203): at net.sqlcipher.database.SQLiteDatabase.a(Unknown Source)
E/AndroidRuntime(18203): at net.sqlcipher.database.SQLiteDatabase.a(Unknown Source)
E/AndroidRuntime(18203): at com.mycompany.android.myapplib.sqlite.MyProvider.onCreate(Unknown Source)
E/AndroidRuntime(18203): at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
E/AndroidRuntime(18203): at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
E/AndroidRuntime(18203): at android.app.ActivityThread.installProvider(ActivityThread.java:4790)
E/AndroidRuntime(18203): at android.app.ActivityThread.installContentProviders(ActivityThread.java:4385)
E/AndroidRuntime(18203): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4325)
E/AndroidRuntime(18203): at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime(18203): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(18203): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18203): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(18203): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(18203): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(18203): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(18203): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(18203): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(18203): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(18203): Caused by: java.lang.NoClassDefFoundError: net/sqlcipher/database/SQLiteStatement
E/AndroidRuntime(18203): ... 22 more
E/AndroidRuntime(18203): Caused by: java.lang.NoClassDefFoundError: net/sqlcipher/database/SQLiteProgram
E/AndroidRuntime(18203): ... 22 more
E/AndroidRuntime(18203): Caused by: java.lang.NoClassDefFoundError: net/sqlcipher/database/SQLiteQuery
E/AndroidRuntime(18203): ... 22 more
E/AndroidRuntime(18203): Caused by: java.lang.NoClassDefFoundError: net/sqlcipher/database/SQLiteCompiledSql
E/AndroidRuntime(18203): ... 22 more
E/AndroidRuntime(18203): Caused by: java.lang.NoSuchFieldError: no field with name='mNativeHandle' signature='I' in class Lnet/sqlcipher/database/SQLiteDatabase;
E/AndroidRuntime(18203): ... 22 more
These are the config I've used in the past for SQLcipher
-keep public class net.sqlcipher.** {
*;
}
-keep public class net.sqlcipher.database.** {
*;
}
这篇关于Android的Proguard的SqlCipher的NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!