[JAVA] Ich habe eine Frage zu Android Studio.

Ich erstelle meine eigene Android-App, aber wenn ich die App starte, heißt es, dass sie wiederholt gestoppt wird und nicht funktioniert. Ich habe Logcat überprüft, aber es wird wie folgt angezeigt. Es ist nicht gut verstanden. Wie kann ich es reparieren?

2020-07-10 22:39:52.674 17730-17730/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.fumemo, PID: 17730 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.fumemo/com.example.fumemo.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThreadH.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInitMethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.ApplicationInfo android.content.Context.getApplicationInfo()' on a null object reference at android.content.ContextWrapper.getApplicationInfo(ContextWrapper.java:163) at android.view.ContextThemeWrapper.getTheme(ContextThemeWrapper.java:174) at android.content.Context.obtainStyledAttributes(Context.java:738) at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:692) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659) at androidx.appcompat.app.AppCompatDelegateImpl.findViewById(AppCompatDelegateImpl.java:479) at androidx.appcompat.app.AppCompatActivity.findViewById(AppCompatActivity.java:214) at com.example.fumemo.MainActivity.(MainActivity.java:35) at java.lang.Class.newInstance(Native Method) at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95) at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41) at android.app.Instrumentation.newActivity(Instrumentation.java:1250) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3182) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThreadH.handleMessage(ActivityThread.java:2016)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7356)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInitMethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

Recommended Posts

Ich habe eine Frage zu Android Studio.
Ich habe eine Frage zur Tastatureingabe von Zahlen
Beachten Sie, dass Junit 4 zu Android Studio hinzugefügt wurde
Ich habe ein Symbol, das in Android Studio nicht aufgelöst werden kann
Ich habe eine Frage. Beim Abspielen eines Videos in Listview mit Android tritt ein Fehler auf.
Ich habe eine Frage, weil das Gradle-Setup nicht funktioniert
[Android] Ich habe eine Schrittzähler-App erstellt.
Ich habe versucht, eine einfache Karten-App in Android Studio zu erstellen
Ich habe eine Taschenrechner-App für Android erstellt
Ich habe eine Janken App mit Android gemacht
[Swift] [Anfänger] Ich habe viel nach #selector gesucht
Ich habe versucht, eine Datenbankverbindung in der Android-Entwicklung zu verwenden
[Android Studio] Ich möchte eine Maven-Bibliothek unter Android verwenden
Ich habe eine Bibliothek zum Anzeigen von Tutorials auf Android erstellt.
Fragen und Antworten zu JDK
Hinweise zu Android Studio
Android Studio Teil 3-6 besiegen
Android Studio Teil 1 und Teil 2 besiegen
Informationen zu Android-App-Komponenten
So machen Sie einen Screenshot mit dem Android Studio-Emulator
Verwenden Sie ein JDK eines anderen OpenJDK-Anbieters in Android Studio
Ich bin froh, eine Methode zu haben, um Zeichen auf Android zu blinken
Ich habe ein ActionController :: MissingExactTemplate, obwohl ich eine Datei habe