Question

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.

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);

This results in the following error.

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

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.

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

Any ideas as to why this might be?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top