0

I'm trying to use BoofCV and I have the JAR in my /libs folder, with the rest of the JARs my app uses (and they work correctly) but it keeps giving me this error

04-26 15:53:12.110: E/AndroidRuntime(29683): java.lang.NoClassDefFoundError: boofcv.struct.geo.AssociatedPair

Even though I can go over to the jar file, navigate to that location and see AssociatedPair.class where it should be.

The jar is in my build path with the others so I don't understand why I'm getting this

Rui Marques
  • 8,567
  • 3
  • 60
  • 91
Jared Joke
  • 1,226
  • 2
  • 18
  • 29
  • 1
    "The jar is in my build path" -- if you did this manually, undo it. Just put the JAR in `libs/`, nothing more is necessary, or even helpful. – CommonsWare Apr 26 '13 at 20:05
  • have you checked [these](https://www.google.com/search?q=android%3A+NoClassDefFoundError+for+a+jar&aq=f&oq=android%3A+NoClassDefFoundError+for+a+jar&aqs=chrome.0.57j58j60j62.6110j0&sourceid=chrome&ie=UTF-8)?? – Archie.bpgc Apr 26 '13 at 20:06
  • I did do that. I simply copied it to libs like I did all the others and got the error. I tried adding it to the build path after and it still didn't fix it. Could it have to do with it being built on a different version of the JDK than Android is using? – Jared Joke Apr 26 '13 at 20:29
  • Ah, the problem seems to be it was built using Java 1.7 which Android doesn't support. Does anyone know how to build it with a lower version? I'm using ant so it defaults to the version I have installed on my system which is 1.7... – Jared Joke Apr 26 '13 at 20:31
  • try Clean your projects and restart Eclipse – Husam A. Al-ahmadi Apr 26 '13 at 20:39

1 Answers1

0

As you already mentioned, this is a JDK 1.7 issue. Take a look at the comments section for this article on codeproject, it discusses this very issue:

http://www.codeproject.com/Articles/553637/Real-Time-Computer-Vision-on-Android-using-BoofCV

I have been able to get JDK 1.7 code to work in android using IntelliJ. The other option that worked for me was to recompile every library with JDK 1.6. There might also be a way to get eclipse to work using JDK 1.7 since there is a known fix, but as of a month or two ago it hadn't been incorporated into eclipse.

The latest version of BoofCV v0.14 should be compiled in JDK 1.6 and not JDK 1.7. If you have an older version try upgrading.

lessthanoptimal
  • 2,722
  • 2
  • 23
  • 25