我在启动Android应用程序时遇到了ClassNotFoundException,这导致了一个RuntimeException。
FATAL EXCEPTION: main
Process: com.example.mquran, PID: 15561
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.mquran/com.example.mquran.QuranActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.mquran.QuranActivity" on path: DexPathList[[zip file "/data/app/~~hynbSxiLbBBszkZOGN7mmw==/com.example.mquran-lzohw1JV0FF52fn5hJr6Cg==/base.apk"],nativeLibraryDirectories=[/data/app/~~hynbSxiLbBBszkZOGN7mmw==/com.example.mquran-lzohw1JV0FF52fn5hJr6Cg==/lib/arm64, /system/lib64, /system/system_ext/lib64]]
...
这是清单文件的内容:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:exported="true"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:targetApi="34">
<activity
android:name=".QuranActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我已经搜索了很多来解决这个错误,包括编辑Java类,但是还没有找到有效的解决方案。