2013-10-17 109 views
1

我在我的應用程序中使用@ CommonsWare的CWAC-LoaderEx庫及其SQLiteCursorLoadercwac-loaderex和Proguard

但是,當我嘗試使用Proguard的,我得到了以下警告:

Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader: can't find referenced class net.sqlcipher.database.SQLiteOpenHelper 
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$DeleteTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$InsertTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$ReplaceTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.SQLCipherCursorLoader$UpdateTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.SQLCipherUtils: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.SQLCipherUtils: can't find referenced class net.sqlcipher.database.SQLiteDatabase$CursorFactory 
Warning: com.commonsware.cwac.loaderex.acl.SQLCipherCursorLoader: can't find referenced class net.sqlcipher.database.SQLiteDatabase 
Warning: com.commonsware.cwac.loaderex.acl.SQLCipherCursorLoader$DeleteTask: can't find referenced class net.sqlcipher.database.SQLiteDatabase 

...等等。我已經嘗試添加到我的proguardcfg文件:

-libraryjars libs/CWAC-LoaderEx.jar 
-keep class net.sqlcipher.** { *; } 
-keep class net.sqlcipher.database.** { *; } 

除了默認proguard-android.txt,包含在SDK。

有沒有人有任何想法? 謝謝!

+1

這可能聽起來像是一個愚蠢的問題,但你在項目中有SQLCipher爲Android? CWAC-LoaderEx *使用* SQLCipher for Android,並且演示應用程序具有它的副本,但CWAC-LoaderEx JAR不包含SQLCipher本身。 – CommonsWare

+0

這根本不是一個愚蠢的問題,因爲我沒有在項目中使用SQLCipher!這可能會解決問題,現在就會嘗試。 另一個問題:因爲我沒有使用SQLCipher,我可以告訴Proguard忽略它嗎?因爲該應用程序在調試模式下工作正常。 – leocadiotine

回答

1

因爲我沒有使用SQLCipher,我可以告訴Proguard忽略它嗎?

你可以告訴ProGuard擺脫com.commonsware.cwac.loaderex.SQLCipherCursorLoader,據推測。

警告只是:警告。除了警告之外,我認爲(錯誤地)你崩潰了。只要您從未嘗試過使用SQLCipherCursorLoader,警告不會引起您任何特定問題。

+0

非常感謝您的幫助和出色的圖書館! – leocadiotine

2

如果您的應用程序未使用SQLCipher,您可以告訴ProGuard忽略缺失的類。例如:

-dontwarn net.sqlcipher.** 

請參閱ProGuard手冊>故障排除>Warning: can't find referenced class

您不應在配置文件中指定-injars-libraryjars選項。 Ant/Eclipse/Gradle構建過程已根據項目內容自動爲您指定所有必需的-injars-outjars-libraryjars

見的ProGuard手冊>故障排除>Note: duplicate definition of program/library class

+0

這對我有用。 – Manish