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 ${build.target} 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!
AndroidAndroidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
Can you post your ant build file?
0
AndroidAndroidAuthor 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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndroidAndroidAuthor Commented:
This solution works.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.