Unable to instantiate activity ComponentInfo


不知道怎麼回事,在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,從新運行工程,問題解決。

以下圖: java

相關文章
相關標籤/搜索