我有一個Android開發應用程序的問題。我首先進行了一項研究,發現我的錯誤,並且發現有其他人像我一樣遇到同樣的問題。我閱讀了所有的評論,但仍然有同樣的錯誤。Android:無法實例化活動ComponentInfo
這裏我的錯誤
05-29 12:39:36.701: E/AndroidRuntime(823): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.georgepanayi.mixfmcyprus.radio/com.georgepanayi.mixfmcyprus.radio.Main_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.georgepanayi.mixfmcyprus.radio.Main_Activity" on path: /data/app/com.georgepanayi.mixfmcyprus.radio-1.apk
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.os.Handler.dispatchMessage(Handler.java:99)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.os.Looper.loop(Looper.java:137)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread.main(ActivityThread.java:5041)
05-29 12:39:36.701: E/AndroidRuntime(823): at java.lang.reflect.Method.invokeNative(Native Method)
05-29 12:39:36.701: E/AndroidRuntime(823): at java.lang.reflect.Method.invoke(Method.java:511)
05-29 12:39:36.701: E/AndroidRuntime(823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-29 12:39:36.701: E/AndroidRuntime(823): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-29 12:39:36.701: E/AndroidRuntime(823): at dalvik.system.NativeStart.main(Native Method)
05-29 12:39:36.701: E/AndroidRuntime(823): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.georgepanayi.mixfmcyprus.radio.Main_Activity" on path: /data/app/com.georgepanayi.mixfmcyprus.radio-1.apk
05-29 12:39:36.701: E/AndroidRuntime(823): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
05-29 12:39:36.701: E/AndroidRuntime(823): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-29 12:39:36.701: E/AndroidRuntime(823): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
05-29 12:39:36.701: E/AndroidRuntime(823): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
05-29 12:39:36.701: E/AndroidRuntime(823): ... 11 more
我已閱讀,這個問題是與清單中的活動,這裏是我的類和清單 類
package com.georgepanayi.mixfmcyprus.radio;
import org.holoeverywhere.app.Activity;
import android.os.Bundle;
public class Main_Activity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_mix_fm__main);
}
}
清單
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.georgepanayi.mixfmcyprus.radio"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Mixfmradio" >
<activity
android:name=".Main_Activity"
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>
另外我使用的庫如Holoeverywhere,SherlockActionBar 4.3。 1和ViewPagerIndicator 2.4.1
任何人都可以找到問題嗎?
謝謝
在這種情況下,請嘗試同步您的項目 – clwhisk