021-01-26 16:05:27.105 25286-25394/com.example.projetoroom E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.example.projetoroom, PID: 25286
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:353)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.IllegalStateException: Migration didn't properly handle Telefone(com.example.projetoroom.model.Telefone).
Expected:
TableInfo{name='Telefone', columns={tipo=Column{name='tipo', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, alunoId=Column{name='alunoId', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=1}, numero=Column{name='numero', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}}, foreignKeys=[], indices=[]}
Found:
TableInfo{name='Telefone', columns={tipo=Column{name='tipo', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, numero=Column{name='numero', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, alunoid=Column{name='alunoid', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, id=Column{name='id', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=1}}, foreignKeys=[], indices=[]}
at com.example.projetoroom.database.AgendaDatabase_Impl$1.validateMigration(AgendaDatabase_Impl.java:95)
at androidx.room.RoomOpenHelper.onUpgrade(RoomOpenHelper.java:88)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onUpgrade(FrameworkSQLiteOpenHelper.java:133)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:338)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:238)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:96)
at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:54)
at androidx.room.RoomDatabase.query(RoomDatabase.java:238)
at com.example.projetoroom.database.dao.AlunoDAO_Impl.todos(AlunoDAO_Impl.java:141)
at com.example.projetoroom.asynctask.BuscaAlunosTask.doInBackground(BuscaAlunosTask.java:23)
at com.example.projetoroom.asynctask.BuscaAlunosTask.doInBackground(BuscaAlunosTask.java:11)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 4 more