Shortly summerized, my project structure is like follows:
- A and B are android lib-projects, where B depends on A
- C (normal android project) depends on B
- T is test-project of C
I have correspondingly two projects on my jenkins server, one for C and one for T, which have their own script for build, using actually just android and ant commands. So there is no problem with the build of C, but i can't get work build of T.
"Work" should there mean, that, depending on the script, it either don't compile or do fail at runtime because of some missing classes, that actually could't be, or don't pass the dexing phase because of adding duplicates.
So it's clear, that there is something wrong with the dependencies, but the interesting thing is that it works very nice on local machine with eclipse & on emulator.
So here an example shell-script code, that actually should work and create an apk-file:
cd project-test
android update test-project -m ../projectC -p .
ant clean debug
This causes unfortunately that some classes from from B, that i'm also going to test, couldn't be found from the java compiler and i get always error like this:
...
[javac] Compiling 14 source files to /home/mehmed/git/project/test-project/bin/classes
[javac] SomeActivityTest.java:8: package com.mydomain.portal.android.project.activity does not exist
[javac] import com.mydomain.portal.android.project.activity.SomeClass1;
[javac] ^
[javac] SomeActivityTest.java:9: package com.mydomain.portal.android.project.data does not exist
[javac] import com.mydomain.portal.android.project.data.SomeClass2;
[javac] ^
[javac] SomeActivityTest.java:10: package com.project.portal.android.project.util does not exist
[javac] import com.mydomain.portal.android.project.util.SomeClass3;
[javac] ^
...
I did try almost everything possible to fix that, even manually editing the project.properties file and including just B or B and C at the same time as lib-projects like this:
cd project-test
android update test-project -m ../projectC -p .
echo "android.library.reference.1=../projectB" >> project.properties
# or even also projectA:
echo "android.library.reference.2=../projectA" >> project.properties
ant clean debug
which results this time in dexing errors because of duplicate adding of the classes from lib-projects.
Does somebody have any ideas about fixing this? Thanks for help in advance!