gpt4 book ai didi

android - 使用 proguard Android 后数据库崩溃

转载 作者:行者123 更新时间:2023-12-03 17:16:06 25 4
gpt4 key购买 nike

我的应用程序在 Debug模式下运行良好,但在启用 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.**

最佳答案

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

关于android - 使用 proguard Android 后数据库崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36741616/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com