我刚刚将我的一个项目复制到一个新的项目空间,当我从新创建的项目运行应用程序时,它崩溃了并且 logcat
生成了以下错误。我检查了manifest 文件
,似乎没有什么问题。请帮助我找出导致崩溃的错误。
更新 list 文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.meetingpointlocator_03test00"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.meetingpointlocator_03test00.Intro"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.meetingpointlocator_03test00.MainMenuActivity"
android:label="@string/title_activity_mpl" >
</activity>
<activity
android:name="com.example.meetingpointlocator_03test00.AddNewLocationActivity"
android:label="@string/title_activity_add_new_location" >
</activity>
<activity
android:name="com.example.meetingpointlocator_03test00.MeetingPointFix"
android:label="@string/title_activity_meeting_point_fix" >
</activity>
<activity
android:name="com.example.meetingpointlocator_03test00.AHActivity"
android:label="@string/title_activity_navigate"
android:screenOrientation="landscape"
android:theme="@style/Theme.AppCompat.Light"
android:configChanges="keyboardHidden|orientation">
</activity>
</application>
更新的 Logca:
06-07 17:50:49.056: E/AndroidRuntime(31571): FATAL EXCEPTION: main
06-07 17:50:49.056: E/AndroidRuntime(31571): Process:
com.example.meetingpointlocator_03test00, PID: 31571
06-07 17:50:49.056: E/AndroidRuntime(31571): java.lang.RuntimeException: Unable to
instantiate activity
ComponentInfo{com.example.meetingpointlocator_03test00/com.example.meetingpointlocator_03test00.Intro}: java.lang.ClassNotFoundException: Didn't find class "com.example.meetingpointlocator_03test00.Intro" on path: DexPathList[[zip file "/data/app/com.example.meetingpointlocator_03test00-3.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.meetingpointlocator_03test00-3, /vendor/lib, /system/lib]]
06-07 17:50:49.056: E/AndroidRuntime(31571): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
06-07 17:50:49.056: E/AndroidRuntime(31571): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2340)
最佳答案
com.example.meetingpointlocator_03Test00.Intro
看起来,启动 intro 应用程序时存在某种拼写错误,在您的 list 文件中,包名称为 com.example.meetingpointlocator_03test00.Intro
的 Activity 除外包名称是:com.example.meetingpointlocator_03Test00.Intro
看到 T 在异常 Test00 中是大写的,在 list 中是 test00。希望能解决您的问题!
关于java - 如何修复 ClassNotFoundException 生成的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24083577/