NoClassDefFoundError with Mapsforge 0.4.0 and Eclipse

吃可爱长大的小学妹 提交于 2019-12-01 10:55:23

NoClassDefFound is really a hard Exception to solve,a workaround you can try.

workaroud: Java Build Path -> Oeder and Export -> make sur 3rd.jar above yourPath/src

I know android support java7, only when you use the version above 19.

@Ninja pointed me in the right direction but I'll post the detailed steps here.

Short answer: You need version 19 or higher of the Android toolchain, as that version introduced the Java 7 support needed to build against the prebuilt Mapsforge 0.4.0 libraries.

How to update:

  • Start ADT. Update all installed packages and additionally select at least one version of Android SDK Build-tools that is 19 or higher. (You can have multiple versions of the Android SDK Build-tools installed alongside each other.)
  • Now open Eclipse and select Help > Check for Updates from the menu.
    • If you get an error message that no software sources are available, go to Help > Install new software. In the dialog, click Add and add a new repository named ADT Plugin, URL https://dl-ssl.google.com/android/eclipse/. Then retry.
  • Restart Eclipse when prompted to do so.
  • Setting the compiler compliance level turned out not to be necessary in my case (I left it at 1.6).

With these steps my Mapsforge project works – I can display a map and the NoClassDefFoundError is gone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!