我使用Android sDK,我有这个manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.deomanapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.deomanapp.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
但我的应用程序在启动时崩溃,而logcat说:
04-22 03:48:29.770: E/AndroidRuntime(2307): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.deomanapp.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.deomanapp-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.deomanapp-2, /vendor/lib, /system/lib]
我搜索了一会儿,当你没有把活动放在清单中时,通常会发现这个错误,但是我的清单有这个活动。我怎么能纠正它?