Q:

Room is very inconvinient... what's ther problem?

I'v got the error
  Caused by: java.lang.IllegalStateException: Migration didn't properly handle memolist(com.jakchang.savelocation.Entity.MemoEntity).
     Expected:
    TableInfo{name='memolist', columns={date=Column{
name='date', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, fontType=Column{name='fontType', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
address=Column{name='address', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
nation=Column{name='nation', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
city=Column{name='city', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
latitude=Column{name='latitude', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
title=Column{name='title', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
uri2=Column{name='uri2', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
uri3=Column{name='uri3', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'},
 uri1=Column{name='uri1', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
isDeleted=Column{name='isDeleted', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
id=Column{name='id', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=1, defaultValue='null'}, 
tag=Column{name='tag', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
text=Column{name='text', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
uri4=Column{name='uri4', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}, 
longitude=Column{name='longitude', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0, defaultValue='null'}},
 foreignKeys=[], indices=[]}
     Found:

I think I wrote right way the entity.. but I got the error.
I'm using livedata with mvvm.
Please Let me know to solve this....
Entity

@Entity(tableName = "memolist")
public class MemoEntity {
    @PrimaryKey(autoGenerate = true)
    @NonNull
    int id;
    @ColumnInfo(name ="latitude")
    String latitude;
    @ColumnInfo(name ="longitude")
    String longitude;
    @ColumnInfo(name ="nation")
    String nation;
    @ColumnInfo(name ="city")
    String city;
    @ColumnInfo(name ="address")
    String address;
    @ColumnInfo(name ="title")
    String title;
    @ColumnInfo(name ="tag")
    String tag;
    @ColumnInfo(name ="date")
    String date;
    @ColumnInfo(name ="uri1")
    String uri1;
    @ColumnInfo(name ="uri2")
    String uri2;
    @ColumnInfo(name ="uri3")
    String uri3;
    @ColumnInfo(name ="uri4")
    String uri4;
    @ColumnInfo(name ="text")
    String text;
    @ColumnInfo(name ="fontType")
    String fontType;
    @ColumnInfo(name ="isDeleted")
    String isDeleted;

    public MemoEntity(){}
    getter/setter~~
} 

is it important to match the below tableinfo sequence and entity sequence?
hard to study alone....
really I wanna solve this...

A:

Check the error message and especially the differences between excepted and found. It can be an issue with a default value in your migration script.
For example, using the Room 2.1.0 and adding a new integer in my Entity, I have set a default value :
object MIGRATION_1_2 : Migration(1, 2) {
    override fun migrate(database: SupportSQLiteDatabase) {
        database.execSQL("ALTER TABLE entity ADD COLUMN newInteger INTEGER NOT NULL DEFAULT 0")
    }
}

