使用proguard Android后数据库崩溃

时间:2016-04-20 10:55:31

标签: android database crash proguard

我的应用程序在调试模式下运行正常,但在启用proguard并生成签名apk后崩溃:

我正在使用android studio 1.5构建apk。

请在下面找到崩溃日志:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.carwale.autobiz/com.carwale.autobiz.activities.ActivityDashboardDrawer}: android.database.sqlite.SQLiteException: duplicate column name: a (code 1): , while compiling: CREATE TABLE IF NOT EXISTS TC_CARCONDITION (_id integer primary key autoincrement,A TEXT,B TEXT,C TEXT,D TEXT,E TEXT,F TEXT,G TEXT,H TEXT,I TEXT,J TEXT,K TEXT,L TEXT,M TEXT,N TEXT,O TEXT,P TEXT,Q TEXT,R TEXT,S TEXT,T TEXT,U TEXT,a TEXT,b TEXT,c TEXT,d TEXT,e TEXT,f TEXT,g TEXT,h TEXT,i TEXT,j TEXT,k TEXT,l TEXT,m TEXT,n TEXT,o TEXT,p TEXT,q TEXT,r TEXT,s TEXT,t TEXT,u TEXT,v TEXT,w TEXT,x TEXT,y TEXT,z TEXT);
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2303)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:147)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:135)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5234)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at java.lang.reflect.Method.invoke(Method.java:372)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
                                                    Caused by: android.database.sqlite.SQLiteException: duplicate column name: a (code 1): , while compiling: CREATE TABLE IF NOT EXISTS TC_CARCONDITION (_id integer primary key autoincrement,A TEXT,B TEXT,C TEXT,D TEXT,E TEXT,F TEXT,G TEXT,H TEXT,I TEXT,J TEXT,K TEXT,L TEXT,M TEXT,N TEXT,O TEXT,P TEXT,Q TEXT,R TEXT,S TEXT,T TEXT,U TEXT,a TEXT,b TEXT,c TEXT,d TEXT,e TEXT,f TEXT,g TEXT,h TEXT,i TEXT,j TEXT,k TEXT,l TEXT,m TEXT,n TEXT,o TEXT,p TEXT,q TEXT,r TEXT,s TEXT,t TEXT,u TEXT,v TEXT,w TEXT,x TEXT,y TEXT,z TEXT);
                                                       at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                       at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
                                                       at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
                                                       at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                       at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
                                                       at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
                                                       at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1674)
                                                       at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1605)
                                                       at com.carwale.localdatautils.l.onCreate(Unknown Source)
                                                       at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:251)
                                                       at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
                                                       at com.carwale.localdatautils.s.e(Unknown Source)
                                                       at com.carwale.localdatautils.d.d(Unknown Source)
                                                       at com.carwale.autobiz.activities.at.a(Unknown Source)
                                                       at com.carwale.autobiz.activities.at.<init>(Unknown Source)
                                                       at com.carwale.autobiz.activities.ActivityDashboardDrawer.v(Unknown Source)
                                                       at com.carwale.autobiz.activities.ActivityDashboardDrawer.onCreate(Unknown Source)
                                                       at android.app.Activity.performCreate(Activity.java:5984)
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363) 
                                                       at android.app.ActivityThread.access$800(ActivityThread.java:147) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:135) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:5234) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at java.lang.reflect.Method.invoke(Method.java:372) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704) 


   04-20 08:35:14.326 915-1810/? E/ActivityManager: Invalid thumbnail dimensions: 0x0

请在下面找到我的proguard-rules文件:

-dontwarn org.apache.**
-dontwarn android.net.**
-dontwarn com.alexvasilkov.**
-dontwarn android.content.**
-dontwarn android.graphics.**
-dontwarn android.util.**
-dontwarn com.squareup.picasso.**
-dontwarn android.view.**

1 个答案:

答案 0 :(得分:0)

SQLite不区分大小写。所以A和a是同一个名字。您需要更改列的名称。