Archeg
Archeg

Reputation: 8462

Debugging external libs in Android

I have several .jar files I want to reference into my Android project, and I have the sources for them. The point is that in order to build .jar's from sources, I have to use Maven - the build process is pretty complicated, and as I am new to both Android and Maven, I am trying to reuse the script for building these libraries that was written before me, and do not add the sources directly.

So my intentions were pretty simple:

  1. Build the .class files via Maven script
  2. Compile .jar from these .class files via jar tool in the command line
  3. Reference these libraries from my android project.

But as soon as I copy .jar files to the libs folder in the android project - I cannot add sources on them - and I cannot debug those.

Looks like this issue has been several times on SO here or here. Still nothing works for me. .properties file doesn't seem to be recognized by Eclipse, when I go to Java Build Path - the path to the sources is marked as (None) and it is not modifiable, and if I reference the libraries like it was before ADT17 (adding a custom directory like lib with no s in the end, and referencing these jars as external libraries) - this fixes the debugging, but the compiler doesn't seem to include all the source code due to this

I've read that should be fixed in ADT20, but I am using ADT21 and still no luck. Any usable workaround of this?

Upvotes: 0

Views: 990

Answers (1)

Archeg
Archeg

Reputation: 8462

Finally did it! That still looks like a bug in ADT. The only solution I found is to reference the libs as it was before ADT17 (put them into the separate lib folder without 's', add them to build path, and mark the checkboxes in the Configure Build Path -> Order and Export).

The thing I was missing is actually marking the checkboxes - for some reason when you change anything in that dialog, the checkboxes are becoming unmarked. I guess I just didn't notice that...

Upvotes: 1

Related Questions