Android: Unable to instantiate activity ComponentInfo

匿名 (未验证) 提交于 2019-12-03 01:08:02

问题:

I have a problem on android developing app. I made a research first my error and i found out that there are other people who are having the same problem like me. I read all the comments a tried everything but still i'm having the same error.

Here my error

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 

I have read that the problem is with the activity on the manifest and here is my class and the manifest class

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);     }  } 

manifest

Also I'm using libraries like Holoeverywhere, SherlockActionBar 4.3.1 and ViewPagerIndicator 2.4.1

can anyone find the problem?

Thank you

回答1:

The problem was with the Holoeverywhere. what I have done in order to solve the problem was to go to the properties of my project -> Java build path -> order and export and then select the option android private libraries. then i have added the android:name="org.holoeverywhere.app.Application" inside of the tag in the manifest.



回答2:

This is my manifest. Works for me. You need android:name="MyApp" in application declaration.

You can see the project demo https://github.com/Prototik/HoloEverywhere.git



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!