Unable to instantiate activity ComponentInfo或java.lang.ClassNotFoundException: com.ibright.herolegen

不知道怎么回事,在libs中添加了jar包后,无法给jar包附加上源码,于是采取以下措施:
删除自动生成的依赖:
在Android Dependences目录上右击->Build Path ->Remove from Build Path
然后往libs中拖入jar包,然后添加jar的引用,这样,就可以给jar包附上源码了。
但是运行程序的时候,报以下的错误:

10-16 22:11:54.549: E/AndroidRuntime(2167): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ibright.herolegend/com.ibright.herolegend.launcher.HeroLegendLauncher}: java.lang.ClassNotFoundException: com.ibright.herolegend.launcher.HeroLegendLauncher in loader dalvik.system.PathClassLoader[/data/app/com.ibright.herolegend-1.apk]

于是猜测是依赖引起的问题,解决办法:
在工程上右键->属性[或者 alter+Enter],进入Java Build Path ,order and export,勾选刚刚引入的jar包,确定,然后clear,重新运行工程,问题解决。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值