每当我运行我的 android 应用程序时,都会出现异常:
05-07 12:03:55.356: E/AndroidRuntime(589): FATAL EXCEPTION: main
05-07 12:03:55.356: E/AndroidRuntime(589): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{packgname/de.fau.fsahoy.android.api15.Activities.LoginActivity}: java.lang.ClassNotFoundException: de.fau.fsahoy.android.api15.Activities.LoginActivity
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.os.Handler.dispatchMessage(Handler.java:99)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.os.Looper.loop(Looper.java:137)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.reflect.Method.invokeNative(Native Method)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.reflect.Method.invoke(Method.java:511)
05-07 12:03:55.356: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-07 12:03:55.356: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-07 12:03:55.356: E/AndroidRuntime(589): at dalvik.system.NativeStart.main(Native Method)
05-07 12:03:55.356: E/AndroidRuntime(589): Caused by: java.lang.ClassNotFoundException: packgname.Activities.LoginActivity
05-07 12:03:55.356: E/AndroidRuntime(589): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
05-07 12:03:55.356: E/AndroidRuntime(589): ... 11 more
但是,在我的 AndroidManifest.xml 中,恕我直言没有错:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.fau.fsahoy.android.api15"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="@drawable/fsa_launcher"
android:label="@string/AppName">
<activity
android:name=".Activities.LoginActivity"
android:label="@string/AppName">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activities.MainMenuActivity"></activity>
<activity android:name=".Activities.ProfileActivity"></activity>
</application>
</manifest>
我对这个问题很着迷,并试图在过去 3 个小时左右解决它:<
目前我正在通过将代码复制并粘贴到另一个干净的项目来重建应用程序。我希望这行得通。无论如何,我看到很多人都有这个问题。它是什么?