0

I am using Netbeans 7.1.1 and nbandroid plugin updated to latest this morning. When I made a build, everything built fine. I installed the apk on a device that is running Android 2.3.3. I am using sdk tools r19.

I see java.lang.NoClassDefFoundError in logcat when I try to start it.

My ant build script is copying all the libs the apk depends on to its libs directory and building it. For some reason, some classes are not getting packaged into the apk.

Is it a known issue? Is there a workaround?

I see some workarounds for eclipse along the lines of creating a libs folder (instead of lib folder) under project dir. I have libs property jar.libs.dir configured to point to a folder outside of my project. This all seemed to work before, not now.

RivieraKid
  • 5,923
  • 4
  • 38
  • 47
videoguy
  • 1,732
  • 2
  • 24
  • 49
  • 4
    "I have libs property jar.libs.dir configured to point to a folder outside of my project. This all seemed to work before, not now." -- remove that property, move your JARs into `libs/`, and all should work. – CommonsWare May 12 '12 at 23:14
  • 1
    Have a look at this useful link: [Solving ClassDefNotFound error][1] [1]: http://stackoverflow.com/questions/9870995/android-java-lang-noclassdeffounderror – Simone Casagranda May 12 '12 at 23:43
  • I am going to try this. IMHO, it is bad design on Android teams part for not thinking through before designing their ant build system. – videoguy May 13 '12 at 06:05

1 Answers1

2
  1. Remove the jar.libs.dir property you described.
  2. Move your JAR files into the libs directory.

This should give you the expected results.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
  • I have a similar problem, not with jars but with an external module I developed to incluse all of my DTOs. How can I fix this? – Alberto M Jul 10 '18 at 10:01