如何修复ClassNotFoundException生成的错误

时间:2014-06-06 13:55:37

标签: java android

我刚刚将我的一个项目复制到一个新的项目空间,当我从新创建的项目中运行App时,它崩溃并且logcat生成以下错误。我检查了manifest file,似乎没有任何问题。请帮我找出导致崩溃的错误。

更新的清单文件

<?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)

2 个答案:

答案 0 :(得分:1)

您似乎正在调用不在构建路径中的库。 这是什么类&#34; com.example.meetingpointlocator_03Test00.Intro&#34;? 据我所知,java中的类应该是* .java

答案 1 :(得分:1)

com.example.meetingpointlocator_03Test00.Intro

看起来,通过启动介绍应用程序会出现某种拼写错误,在清单文件中,包名称的活动为com.example.meetingpointlocator_03test00.Intro,并且包含名称的活动为例外:com.example.meetingpointlocator_03Test00.Intro看到T是异常 Test00 的资本,而清单中的是 test00 。希望能解决你的问题!