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

ResolvidoAgenda has stopped - FATAL EXCEPTION: main

Edit: Consegui resolver, era uma situação simples, eu tinha alterado o nome da classe Activity e o android estava startando e procurando a classe sem a alteração do nome. Alterei o nome da classe para o original e deu certo. Oii, to no inicio do curso e toda vez que uso o emulador, ele informa o erro : Agenda has stopped - Open app again / Agenda keeps stopping - Close app.

<ListView
    android:id="@+id/lista_alunos"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

package vs.br.agenda;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.ListView;

public class ListaAlunosActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_lista_alunos);

    String[] alunos = {"Daniel", "Vagner", "Murilo", "Tulio"};
    ListView listaAlunos = findViewById(R.id.lista_alunos);
   ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, alunos);
    listaAlunos.setAdapter(adapter);
}

}

01/19 19:53:11: Launching 'app' on Vanessa. Install successfully finished in 2 s 207 ms. $ adb shell am start -n "vs.br.agenda/vs.br.agenda.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Connected to process 10383 on device 'Vanessa [emulator-5554]'. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/art: Late-enabling -Xcheck:jni W/art: Unexpected CPU variant for X86 using defaults: x86 W/System: ClassLoader referenced unknown path: /data/app/vs.br.agenda-1/lib/x86 D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: vs.br.agenda, PID: 10383 ** java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{vs.br.agenda/vs.br.agenda.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "vs.br.agenda.MainActivity"** on path: DexPathList[[zip file "/data/app/vs.br.agenda-1/base.apk"],nativeLibraryDirectories=[/data/app/vs.br.agenda-1/lib/x86, /system/lib, /vendor/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) *Caused by: java.lang.ClassNotFoundException: Didn't find class "vs.br.agenda.MainActivity" *on path: DexPathList[[zip file "/data/app/vs.br.agenda-1/base.apk"],nativeLibraryDirectories=[/data/app/vs.br.agenda-1/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at android.app.Instrumentation.newActivity(Instrumentation.java:1078) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6119) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Connected to process 10529 on device 'Vanessa [emulator-5554]'. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the

2 respostas
solução!

consegue mandar um print das pastas e arquivos do seu projeto ? digo da parte que fica na esquerda, acho que você acabou colocando coisa fora de ordem, mas te confirmo quando mandar :)

Consegui resolver, era uma situação simples, eu tinha alterado o nome da classe Activity e o android estava startando e procurando a classe sem a alteração do nome. Alterei o nome da classe para o original e deu certo.