进口JAR后的And​​r​​oid java.lang.NoClassDefFoundError的 [英] Android java.lang.NoClassDefFoundError after import JAR

查看:148
本文介绍了进口JAR后的And​​r​​oid java.lang.NoClassDefFoundError的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题...

我做了一个瓶子(称为GeoFence.jar),我有一个Android项目使用。 所以,我所做的是:

I made a Jar (called "GeoFence.jar"), that I have to use on a Android Project. So, what I done is:

  1. 看在这么多网方法文档的
  2. 在Android项目创建库文件夹中。
  3. 加入我的JAR(手动)
  4. 然后我去了Java构建路径,并检查了我的JAR被列入到Android的依赖性。
  5. 最后我做了必要的进口,以用我需要的JAR类。

做到这一切后,我拼命地跑我的应用程序,它抛出这个错误:

After do all of this, I runned my App, and it throws this error:

和我不明白这是怎么回事,原因,我修正了项目属性并清除它。它仍然没有工作。

and I don't understand what's going on, cause, I Fixed the Project Properties and cleaned it. And it's still not working.

下面是我如何结构和构建路径。

Here is how i have the structure and the build path.

推荐答案

如果你到你的Andr​​oid依赖文件夹,你应该能够扩大GeoFence.jar文件。这样一来,你应该能够找到类 com.elias.polygon.City 如果你不断扩张的子文件夹。

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.

如果您不能看到它,你可能在出口jar文件犯了一个错误。

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

  • To solve the export see this question on so

如果您可以请参阅类的,你有一个错误在您的构建路径/项目属性

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

  • 要解决的项目设置,<一个href="http://stackoverflow.com/questions/1334802/how-can-i-use-external-jars-in-an-android-project">see这个问题

这篇关于进口JAR后的And​​r​​oid java.lang.NoClassDefFoundError的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆