Android Unable to instantiate activity: Didn't find class on path

后端 未结 3 1585
感动是毒
感动是毒 2020-11-27 07:38

I\'ve imported project into eclipse and when I try to run it, then this exception is thrown:

java.lang.RuntimeException: Unable to instantiate activity Compone

相关标签:
3条回答
  • 2020-11-27 08:20

    You should import new appcompat_v7 from sdk and use it as a built path,it works for me.

    0 讨论(0)
  • 2020-11-27 08:22

    After i spend a while on this problem, the solution that i found is a conflict between importing Properties > Android - appcompat_v7 and appcompat_v4 that was added in the libs folder. After i remove the appcompat_v4 the error no longer appear. I hope that answer can help in the future someone.

    0 讨论(0)
  • 2020-11-27 08:23

    I suppose you're using Eclipse. Your activity is there alright, but Eclipse didn't include the support package in the APK ... If you look above your error in stacktrace you will notice the root of your problem: "Unable to find FragmentActivity". Or you can unpack the apk, undex it and you will see the compatibility package classes were not included.

    To fix this, right-click your project, properties, build path and go to export tab. There make sure "Android private libraries" are checked. A clean and rebuild should put you on track ...

    0 讨论(0)
提交回复
热议问题