当前位置:   article > 正文

APP在线升级闪退Caused by: android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed:_code 1299 sqlite_constraint_notnull

code 1299 sqlite_constraint_notnull

项目场景:

APP在线升级


问题描述:

APP直接下载最新的包正常,在线升级闪退报错: java.lang.RuntimeException: Unable to resume activity {com.bj1580.fuse/com.bj1580.fuse.view.activity.HomeActivity}: android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: USER_BASIC_INFO_BEAN.BUSITYPE (Sqlite code 1299 SQLITE_CONSTRAINT_NOTNULL), (OS error - 2:No such file or directory) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4910) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4953) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:190) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:105) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2462) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.os.Handler.dispatchMessage(Handler.java:110) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.os.Looper.loop(Looper.java:219) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.ActivityThread.main(ActivityThread.java:8393) 08-18 09:46:26.202 E/AndroidRuntime(28193): at java.lang.reflect.Method.invoke(Native Method) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055) 08-18 09:46:26.202 E/AndroidRuntime(28193): Caused by: android.database.sqlite.SQLiteConstraintException: NOT NULL constraint failed: USER_BASIC_INFO_BEAN.BUSITYPE (Sqlite code 1299 SQLITE_CONSTRAINT_NOTNULL), (OS error - 2:No such file or directory) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:875) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:776) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:66) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1900) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1817) 08-18 09:46:26.202 E/AndroidRuntime(28193): at org.greenrobot.greendao.database.StandardDatabase.execSQL(StandardDatabase.java:37) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.ggxueche.utils.MigrationHelper.restoreData(MigrationHelper.java:124) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.ggxueche.utils.MigrationHelper.migrate(MigrationHelper.java:38) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.bj1580.fuse.dao.MigrationOpenHelper.onUpgrade(MigrationOpenHelper.java:23) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:436) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:332) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.bj1580.fuse.dao.DaoManager.(DaoManager.java:34) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.bj1580.fuse.dao.DaoManager.getInstance(DaoManager.java:43) 08-18 09:46:26.202 E/AndroidRuntime(28193): at com.bj1580.fuse.view.fragment.RegisterFragment.onResume(RegisterFragment.java:163) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.Fragment.performResume(Fragment.java:2498) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1501) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:3241) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:223) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:538) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:527) 08-18 09:46:26.202 E/AndroidRuntime(28193): at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:172) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.Activity.performResume(Activity.java:8283) 08-18 09:46:26.202 E/AndroidRuntime(28193): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4900) 08-18 09:46:26.202 E/AndroidRuntime(28193): ... 11 more

原因分析:

旧版本本地SQLite数据库中少字段,新版本读取不到报错


解决方案:

测试APP在线升级时,要咨询APP前端数据库或者缓存数据有无变化,重点测试,旧版APP做各种操作后再升级测试。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/267260
推荐阅读
相关标签
  

闽ICP备14008679号