Android java.lang.NoClassDefFoundError after import JAR

微笑、不失礼 提交于 2019-12-04 17:40:35

for adding jar use below two stpe: but for you just do 2nd.

1. Your Project -> right click -> Properties -> Java Build Path -> Libraries -> Add Jar -> yourjar.jar
2. Your Project -> right click -> Properties -> Java Build Path -> Order & Export --> Select All --> OK

After taht just clean your Project and RUN.

Entreco

If you go to you Android Dependencies folder, you should be able to expand the GeoFence.jar file. This way, you should be able to find the class com.elias.polygon.City if you keep expanding subfolders.

If you CANNOT see it, you probably made an error in exporting the jar file.

If you CAN see the class, you have an error in your build path/ project properties

the problem that I had, was that the jar I wanted to import, used some packages that in android are not "allowed" so I had to do in a different way.

After that, it happens the same, but the problem was that the Jar was Build in v1.7. When I builded in v1.6 android accepted it.

So, first of all look for:

  1. Don't use packacges that in android are not allowed
  2. Look in which version is builded the solution.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!