Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Agenda has stopped.

Minha agenda parou de funcionar, segue o erro:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.agenda/com.example.agenda.ListaAlunosActivity}: android.database.sqlite.SQLiteException: no such table: Alunos (code 1): , while compiling: SELECT * FROM Alunos;
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:148)
        at android.app.ActivityThread.main(ActivityThread.java:5417)
        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: Alunos (code 1): , while compiling: SELECT * FROM Alunos;
        at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
        at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
        at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
        at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
        at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
        at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
        at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
        at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1316)
        at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1255)
        at com.example.agenda.DAO.AlunoDAO.buscarAlunos(AlunoDAO.java:50)
        at com.example.agenda.ListaAlunosActivity.onCreate(ListaAlunosActivity.java:24)
        at android.app.Activity.performCreate(Activity.java:6237)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:148) 
        at android.app.ActivityThread.main(ActivityThread.java:5417) 
        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) 
04-12 16:22:36.618 9362-9898/system_process W/ActivityManager:   Force finishing activity com.example.agenda/.ListaAlunosActivity
04-12 16:22:36.928 9362-9898/system_process I/WindowManager: Screenshot max retries 4 of Token{346fa0a ActivityRecord{c397a75 u0 com.example.agenda/.ListaAlunosActivity t66 f}} appWin=Window{db4c062 u0 Starting com.example.agenda} drawState=4
04-12 16:22:36.929 9362-9362/system_process W/art: Long monitor contention event with owner method=void com.android.server.am.ActivityManagerService.crashApplication(com.android.server.am.ProcessRecord, android.app.ApplicationErrorReport$CrashInfo) from ActivityManagerService.java:12502 waiters=0 for 298ms
04-12 16:22:36.988 9362-15696/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
04-12 16:22:36.996 9362-15696/system_process D/EGL_emulation: eglCreateContext: 0x9b6bade0: maj 2 min 0 rcv 2
04-12 16:22:37.020 9362-9513/system_process I/AccountManagerService: getTypesVisibleToCaller: isPermitted? true
04-12 16:22:37.024 9362-15696/system_process D/EGL_emulation: eglMakeCurrent: 0x9b6bade0: ver 2 0 (tinfo 0x9e433e80)
04-12 16:22:37.073 9362-15696/system_process D/EGL_emulation: eglMakeCurrent: 0x9b6bade0: ver 2 0 (tinfo 0x9e433e80)
04-12 16:22:37.431 9362-9376/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{c397a75 u0 com.example.agenda/.ListaAlunosActivity t66 f}
04-12 16:22:37.588 9730-9903/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0xaefd36c0: ver 2 0 (tinfo 0xaefd24b0)
04-12 16:22:47.905 9362-9376/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{c397a75 u0 com.example.agenda/.ListaAlunosActivity t66 f}
04-12 16:23:00.564 1240-1297/? D/hwcomposer: hw_composer sent 188 syncs in 60s

Link Google Drive do projeto: https://drive.google.com/drive/folders/1SV9a68Qzap2ffE64UMCPrbE_ydypCbOM?usp=sharing

2 respostas

Caused by: android.database.sqlite.SQLiteException: no such table: Alunos (code 1): , while compiling: SELECT * FROM Alunos;

Sera que essa tabela alunos foi criada ? =] Da uma olhada ai no banco que vc tem no aparelho usando o Android Studio e alguma IDE de SQLite.

solução!

Eu tinha encontrado o erro, esqueci de colocar aqui. Na verdade a tabela foi criada sim, porém no momento que criei ela eu coloquei INTERGER no lugar de INTEGER então no momento que fui testar deu o erro, mesmo depois de concertar o erro continuou. Faltou apenas mudar a versão do banco.