Caused by: android.database.sqlite.SQLiteException: no such table: (code 1) Android

后端 未结 16 2205
一整个雨季
一整个雨季 2020-12-15 05:01

We have a sqlite database in our Application. Its working fine for all the users but few of them experiencing the Caused by: android.database.sqlite.SQLiteException: n

相关标签:
16条回答
  • 2020-12-15 05:35

    After spending couple of hours I got this solution:

    1) Settings > Application Manager

    2) Select App

    3) Clear Data

    4) Uninstall App

    Now Run app from Android Studio

    Hope this works properly

    0 讨论(0)
  • 2020-12-15 05:38

    If you are using GreenDao and get this error, be sure you are unistalling the app and try again. This solved my problem

    0 讨论(0)
  • 2020-12-15 05:39

    Suppose if you run your app with Database Version 1, then if you alter the table structure or add a new table, you must increase your Database Version to 2 and further if you make more changes to it.

    public class AppDatabase extends SQLiteOpenHelper {
    
        // Database Name
        private static final String DATABASE_NAME = "myDatabase";
    
        // Database Version
        private static final int DATABASE_VERSION = 1;    
    
        public AppDatabase(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }
    }
    

    Increase this DATABASE_VERSION value if any alterations are done.

    0 讨论(0)
  • 2020-12-15 05:39

    1.Change Your DataBase Version Or First Uninstall Your Apps In the Emulator or Phone And Re-install. I In This way Think Your Problem Will be solved.

    0 讨论(0)
  • 2020-12-15 05:39

    kindly initiallize copy database or database helper in main class like that Database helper = new Database(this); helper.execute(sqliteobj)

    0 讨论(0)
  • 2020-12-15 05:42

    Update the DATABASE_VERSION and uninstall the app. Now run the app.

    0 讨论(0)
提交回复
热议问题