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

Não está buscando o aluno que acabei de cadastrar

Boa noite, Após terminar essa video aula, fiquei chateada pois não está gravando o aluno no BD. O erro é o EGL_BAD_MATCH e como sou nova em desenvolvimento mobile, estou meio perdida... alguém pode me ajudar? Abaixo está o log ao tentar executar!

< 02/14 21:52:20: Launching app $ adb push C:\Users\Priscila\AndroidStudioProjects\Agenda\app\build\outputs\apk\app-debug.apk /data/local/tmp/com.menfer.pmf.agenda $ adb shell pm install -r "/data/local/tmp/com.menfer.pmf.agenda" Success

$ adb shell am start -n "com.menfer.pmf.agenda/com.menfer.pmf.agenda.ListaAlunosActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Connected to process 2293 on device Alura_Nexus_S [emulator-5554] I/art: Not late-enabling -Xcheck:jni (already on) W/art: Unexpected CPU variant for X86 using defaults: x86

[ 02-14 23:52:56.110 1571: 1598 D/ ] HostConnection::get() New Host Connection established 0x956388c0, tid 1598 W/System: ClassLoader referenced unknown path: /data/app/com.menfer.pmf.agenda-2/lib/x86 I/InstantRun: Instant Run Runtime started. Android package is com.menfer.pmf.agenda, real application class is null. W/System: ClassLoader referenced unknown path: /data/app/com.menfer.pmf.agenda-2/lib/x86 W/art: Verification of int android.support.v4.app.FragmentActivity.allocateRequestIndex(android.support.v4.app.Fragment) took 109.260ms W/art: Verification of void android.support.v7.app.AppCompatDelegateImplBase.(android.content.Context, android.view.Window, android.support.v7.app.AppCompatCallback) took 124.319ms W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable I/OpenGLRenderer: Initialized EGL, version 1.4 D/OpenGLRenderer: Swap behavior 1 E/EGL_emulation: tid 2385: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH) W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb19cffe0, error=EGL_BAD_MATCH E/EGL_emulation: tid 2385: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH) W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb19d0000, error=EGL_BAD_MATCH W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection E/SQLiteLog: (1) table alunos has no column named enderco E/SQLiteDatabase: Error inserting nome=Priscila nota=10.0 enderco=Rua Teste site=www.google.com.br telefone=45454 android.database.sqlite.SQLiteException: table alunos has no column named enderco (code 1): , while compiling: INSERT INTO alunos(nome,nota,enderco,site,telefone) 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.insertWithOnConflict(SQLiteDatabase.java:1472) at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343) at com.menfer.pmf.agenda.dao.AlunoDAO.insere(AlunoDAO.java:48) at com.menfer.pmf.agenda.FormularioActivity.onOptionsItemSelected(FormularioActivity.java:44) at android.app.Activity.onMenuItemSelected(Activity.java:3204) at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:408) at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:195) at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:113) at android.support.v7.app.AppCompatDelegateImplV9.onMenuItemSelected(AppCompatDelegateImplV9.java:675) at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:822) at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:156) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:969) at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:959) at android.support.v7.widget.ActionMenuView.invokeItem(ActionMenuView.java:623) at android.support.v7.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:154) at android.view.View.performClick(View.java:5610) at android.view.View$PerformClick.run(View.java:22265) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) E/EGL_emulation: tid 2385: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH) W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb19d0fc0, error=EGL_BAD_MATCH E/EGL_emulation: tid 2385: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH) W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xb19d0fe0, error=EGL_BAD_MATCH W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection W/IInputConnectionWrapper: finishComposingText on inactive InputConnection

[ 02-14 23:56:09.598 1248: 3070 D/ ] HostConnection::get() New Host Connection established 0xb2d1bf80, tid 3070 I/art: Background sticky concurrent mark sweep GC freed 28509(2MB) AllocSpace objects, 9(188KB) LOS objects, 55% free, 3MB/6MB, paused 4.963ms total 108.316ms E/EGL_emulation: tid 2385: eglSurfaceAttrib(1146): error 0x3009 (EGL_BAD_MATCH) W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x972d58a0, error=EGL_BAD_MATCH >

2 respostas
solução!

Oi Priscila, tudo bem ?

Dá uma olhadinha no seu onCreate na classe AlunoDao, você chamou a coluna endereco de enderco, e provavelmente no momento de fazer o insert você está passando endereco, ou é o contrário.

Dá uma olhadinha ai !

Espero ter ajudado.

Muito obrigada Matheus!! Era isso mesmo! Dei mole!!! Obrigada!