当我在模拟器上打开它时,该应用程序不断崩溃。这是 activity_main.xml 和我得到的错误。
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/main_nav_host"
android:name="com.example.test_run.main.MainSessionNavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="false" />
</androidx.constraintlayout.widget.ConstraintLayout>
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.test_run.MainActivity" on path: DexPathList[[zip file "/data/app/~~f3SDJdSMUvctPuzredlmhQ==/com.example.test_run-JMnAM1A0EvaUsPTrSDaFwA==/base.apk"],nativeLibraryDirectories=[/data/app/~~f3SDJdSMUvctPuzredlmhQ==/com.example.test_run-JMnAM1A0EvaUsPTrSDaFwA==/lib/arm64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)