question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create/insert in new table: android.database.sqlite.SQLiteException: no such table: "TableName"

See original GitHub issue

DBFlow Version: 4.0.0-beta1 Issue Kind (Bug, Question, Feature): Question

Description: I was using DBflow for my models. After a long time I decided to add an extra model, But I am not able to do so. I am getting an exception saying “No such table”. I tried cleaning the project, selecting “make project” and building again. Previously created models are working without any issue.

10-18 13:24:07.410 1547-1547/com.test.app E/SQLiteLog: (1) no such table: DummyTest 10-18 13:24:07.414 1547-1547/com.test.app D/AndroidRuntime: Shutting down VM 10-18 13:24:07.424 1547-1547/com.test.app E/AndroidRuntime: FATAL EXCEPTION: main Process: com.test.app, PID: 1547 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.app/com.test.app.HomeActivity}: android.database.sqlite.SQLiteException: no such table: DummyTest (code 1): , while compiling: INSERT INTO DummyTest(name) VALUES (?) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2452) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535) at android.app.ActivityThread.access$900(ActivityThread.java:154) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:152) at android.app.ActivityThread.main(ActivityThread.java:5497) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) Caused by: android.database.sqlite.SQLiteException: no such table: DummyTest (code 1): , while compiling: INSERT INTO DummyTest(name) VALUES (?) 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.compileStatement(SQLiteDatabase.java:1006) at com.raizlabs.android.dbflow.structure.database.AndroidDatabase.compileStatement(AndroidDatabase.java:59) at com.raizlabs.android.dbflow.structure.ModelAdapter.getInsertStatement(ModelAdapter.java:64) at com.raizlabs.android.dbflow.structure.ModelAdapter.getInsertStatement(ModelAdapter.java:51) at com.raizlabs.android.dbflow.sql.saveable.ModelSaver.insert(ModelSaver.java:83) at com.raizlabs.android.dbflow.structure.ModelAdapter.insert(ModelAdapter.java:128) at com.raizlabs.android.dbflow.structure.BaseModel.insert(BaseModel.java:95) at com.test.app.HomeActivity.onCreate(HomeActivity.java:122) at android.app.Activity.performCreate(Activity.java:6285) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2535)  at android.app.ActivityThread.access$900(ActivityThread.java:154)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1380)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:152)  at android.app.ActivityThread.main(ActivityThread.java:5497)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)  10-18 13:24:07.424 1547-1547/? D/AppTracker: App Event: crash

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

6reactions
avinashs24commented, Oct 18, 2016

Sorry It just struck for me to uninstall and reinstall the app so that database gets deleted and created from the scratch (Guess this is same as increasing the database version number). I tried now and its working. Thank you

5reactions
fabiendemcommented, Oct 18, 2016

Hi, Have you increased your database version number?

Read more comments on GitHub >

github_iconTop Results From Across the Web

android.database.sqlite.SQLiteException: no such table
I found the fix I was looking for. Go to your AndroidManifest.xml and change the following android:allowBackup="true" ...
Read more >
Caused by android database sqlite SQLiteException no such ...
My SQLite helper class to create the database and the error log is listed below. GeneralSettings is a table in assert/Master.db. But the...
Read more >
android.database.sqlite.SQLiteException: no such table: pvpt
Hello. Developing an app for weeks, I run it many times without any problems, bringing new features every week. This day, it stops...
Read more >
'No such table' returned while the database contains it - SQLite
Hi,. I'm hitting an issue in my application, which basically sums up to the first request executed by a thread failing with 'No...
Read more >
SQLite Create Table with Examples
In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found