GreenDao:no such table 找不到表的终极解决方案!

错误日志:

android.database.sqlite.SQLiteException: no such table: FEED_LOAD_TIMES_ENTITY (code 1): , 
while compiling: INSERT INTO "FEED_LOAD_TIMES_ENTITY" ("_id","LOAD_TIMES") 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.(SQLiteProgram.java:58)  
at android.database.sqlite.SQLiteStatement.(SQLiteStatement.java:31)  
at android.database.sqlite.SQLiteDatabase.compileStatement(SQLiteDatabase.java:994)     
at org.greenrobot.greendao.database.StandardDatabase.compileStatement(StandardDatabase.java:67)     
at org.greenrobot.greendao.internal.TableStatements.getInsertStatement(TableStatements.java:52)     
at org.greenrobot.greendao.AbstractDao.insert(AbstractDao.java:319) 

发生环境:

1.线上app有两张表A、B,数据库版本为3;
2.当前开发版本新增了一个表C,升级数据库版本为4;
3.只安装当前开发版本,没有任何问题;
4.从线上版本升级到开发版本,报上面那个错误,找不到表C。

解决方案:
https://github.com/yuweiguocn/GreenDaoUpgradeHelper

你可能感兴趣的:(GreenDao:no such table 找不到表的终极解决方案!)