Running Android JUnit tests with Ant (with external dependencies): Target “run-tests” does not exist in the project “XY”

I am trying to run Android tests with Ant. I stumbled on the same problems as described here. The solution provided there by emmby, works for me only partially, since I get an error message:

Target "-resource-src" does not exist in the project "MyAppTest". It is used from target "compile"..

To this issue, I found few further stackoverflow sites, for example this.

There, Kais suggests "try to override one of the tasks and have it set the ${} when it is not set.".

1) How would one do what Kais suggests?

2) Is there any better/more up to date solution for running Android JUnit tests with external dependencies than emmby's solution?

I am glad to post more logs/traces/code/further information, when necessary.

I am using SDK version 11. Thank you for your help!
Who is Participating?
AndroidAndroidConnect With a Mentor Author Commented:
I managed to solve the problem by starting all over: reverted the build.xml to default as it was generated. I also transferred all external jar libraries to /libs library and thereafter I can build the tests.
Can you post your ant build file?
AndroidAndroidAuthor Commented:
This solution works.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.