Android Activity ClassNotFoundException - tried everything

前端 未结 15 2276
有刺的猬
有刺的猬 2020-11-22 12:02

I\'ve just refactored an app into a framework library and an application, but now when I try and start the app in the emulator I get the following error stack trace:

15条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 13:00

    classNotFoundException in Java is a subclass of java.lang.Exception and Comes when Java Virtual Machine tries to load a particular class and doesn't found the requested class in classpath.

    Read more: http://javarevisited.blogspot.com/2011/08/classnotfoundexception-in-java-example.html#ixzz3yX3WBeFA

    Try going to Project -> Properties -> Java Build Path -> Order & Export And Confirm Android Private Libraries are checked for your project and for all other library projects you are using in your Application.

    How to deal with the ClassNotFoundException

    1. Verify that the name of the requested class is correct and that the appropriate .jar file exists in your classpath. If not, you must explicitly add it to your application’s classpath.
    2. In case the specified .jar file exists in your classpath then, your application’s classpath is getting overriden and you must find the exact classpath used by your application.
    3. In case the exception is caused by a third party class, you must identify the class that throws the exception and then, add the missing .jar files in your classpath.

提交回复
热议问题