android开发could not find class解决方案

网上下了个demo,导入之后运行错误闪退,log提示找不到主activity的onCreate方法,但是其实都有也不报错。

方案来源:http://blog.sina.com.cn/s/blog_6966c76b01011fye.html

解决办法:

1.所建工程中没有导入jar包,如果是把别人的工程import到自己的eclipse中,需要右击工程Bulid Path->Add Libraries->User Library->User Libraries->new(起一个名字 随便A)->Add Jars(将需要的jar包添加到A中) 如图所示:
Android开发错误——Could <wbr>not <wbr>find <wbr>class

2.在properties中没有设置,右键工程->properties->Java Build Path->Order and Export 将刚刚新建的A勾选->点击ok 就可以了。如图所示:
Android开发错误——Could <wbr>not <wbr>find <wbr>class
这样就可以将jar包一同编译到.apk文件中。在模拟器下运行就不会出Could not find class ** referenced from method **错误了。
原文地址:https://www.cnblogs.com/fanerblog/p/4874743.html