用NoClassDefFoundError的0.4.0 Mapsforge和Eclipse,不能建立 [英] NoClassDefFoundError with Mapsforge 0.4.0 and Eclipse, cannot build

查看:230
本文介绍了用NoClassDefFoundError的0.4.0 Mapsforge和Eclipse,不能建立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用建立一个Mapsforge新的Andr​​oid项目。我知道,因为库需要Java 7构建人已经越来越此问题。不过,我使用的内置工具VERSON 20,它使用Java 7中我也有的Eclipse工具的最新更新版本。事实上,我是在一个干净的安装Android开发工具包。

I am trying to setup a new Android project with Mapsforge. I know that people have been getting this issue because the library requires Java 7 to build. However, I am using Build-Tools verson 20, which uses Java 7. I also have the latest updated version of the Eclipse tools. In fact, I am on a clean install of the Android Developer Kit.

到目前为止,我已经导入mapsforge核心,mapsforge地图,mapsforge-地图的Andr​​oid,mapsforge地图 - AWT和mapsforge地图阅读器。
然后,我尝试用下面的code初始化图形页面:

So far, I have imported mapsforge-core, mapsforge-map, mapsforge-map-android, mapsforge-map-awt, and mapsforge-map-reader. I then tried to initialize a MapView using the following code:

AndroidGraphicFactory.createInstance(thisApp);

这会导致下面的错误。

java.lang.NoClassDefFoundError: org.mapsforge.map.android.graphics.AndroidGraphicFactory

我看着在引用的库,和AndroidGraphicFactory类中的 org.mapsforge.map.android.graphics 定义,并显示出来。当在jar文件中寻找 /斌/ dexedLibs \\ 中,classes.dex文件存在,但旁边没有别的没有。

I looked in the referenced libraries, and the AndroidGraphicFactory class is defined within org.mapsforge.map.android.graphics and shows up. When looking at the jar file within /bin/dexedLibs\, the classes.dex file exists, but there is next to nothing else.

我后面<建议的步骤href=\"https://stackoverflow.com/questions/23587939/noclassdeffounderror-with-mapsforge-0-4-0-and-eclipse\">this回答,但错误依然存在。

I followed the steps suggested by this answer, but the error persists.

任何想法,这可能是为什么?

Any ideas as to why this might be?

推荐答案

您需要把jar文件到 库/ 文件夹insted的添加引用Java构建路径

You need put the jar file into the libs/ folder insted of add reference on java build path.

这篇关于用NoClassDefFoundError的0.4.0 Mapsforge和Eclipse,不能建立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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