0

I'm getting "could not find class" error when I run my app. Understand that compilation and execution path different but I followed the recommendations of another question to create a sub dir under my project of lib and put the jar there but still no luck.

using Eclipse and it is when I run on a device from eclipse (unable to get the broadcast events I want to trigger this code from simulator, i.e. wifi and blue-tooth).

Any way to look at the apk to see what's in it like this jar file? looking around did not see anything.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
captfrank
  • 11
  • 5
  • apk's use the zip file format. Have you tried just unzipping and exploring the directory produced? – Colin D Apr 13 '12 at 17:32
  • @jpm - too bad I couldnt bump that comment by +10. Is it beer:thirty yet? – Perception Apr 13 '12 at 17:33
  • Maybe you get an answer here: [Importing Class from External Jar, Android](http://stackoverflow.com/q/3545185/851432) – Jomoos Apr 13 '12 at 17:36
  • Well I unziped it and got this: inflating: res/layout/main.xml inflating: AndroidManifest.xml extracting: resources.arsc extracting: res/drawable-hdpi/ic_launcher.png extracting: res/drawable-ldpi/ic_launcher.png extracting: res/drawable-mdpi/ic_launcher.png inflating: classes.dex inflating: META-INF/MANIFEST.MF inflating: META-INF/CERT.SF inflating: META-INF/CERT.RSA – captfrank Apr 13 '12 at 17:45
  • I think what Jomoos posted is the issue and is what I did but the diff I think is that I am running it from eclipse and not copying the apk to the droid and running it. Is that what you have to do all the time then you have external jar files? I can't run it from eclipse even if in the build path? – captfrank Apr 13 '12 at 17:51

1 Answers1

0

You probably didn't tell Eclipse to export the required jar files along with other things in your apk file.

Right-click on your Android project and go to Properties. Then go to Java Build Path > Order and Export. Tick the jar files your want to be delivered by your apk file.

Mohammad Banisaeid
  • 2,376
  • 27
  • 35