Ask Your Question
0

Error building Android OpenCV 2.4.2 Tutorial

asked 2012-07-06 16:18:01 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

While trying to build the new OpenCV-2.4.2-android-sdks Tutorial 4, I'm running into errors. I first opened all the projects in Eclipse and fixed some things like Android API target levels, SDK directory, and the ndk-build command (because 2.4.2 was originally configured for Windows, I'm running on Ubuntu 11.10).

However, Eclipse still did not run. So I tried to build Tutorial 4 from the command line. In the tutorial 4 directory, I entered

ant clean

but that ran into this error:

BUILD FAILED

/home/ruifei0713/Documents/Android/android-sdks/tools/ant/build.xml:487: Invalid file: /home/ruifei0713/android-opencv/OpenCV-2.4.2-android-sdk/sdk/java/build.xml

Whenever I try

ant debug

It runs into a similar error:

BUILD FAILED

/home/ruifei0713/Documents/Android/android-sdks/tools/ant/build.xml:570: Invalid file: /home/ruifei0713/android-opencv/OpenCV-2.4.2-android-sdk/sdk/java/build.xml

I'm not sure what this means because /home/ruifei0713/android-opencv/OpenCV-2.4.2-android-sdk/sdk/java/build.xml is definitely an invalid file because it doesn't exist! My question is why it even looks there and how I can fix this to build Tutorial 4 in OpenCV 2.4.2.

Thanks in advance.

edit retag flag offensive close merge delete

Comments

What SDK & NDK versions do you use?

Andrey Pavlenko gravatar imageAndrey Pavlenko ( 2012-07-09 06:49:42 -0600 )edit

I believe SDK 19 and NDK 8

ruifei0713 gravatar imageruifei0713 ( 2012-07-11 12:43:31 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
2

answered 2012-07-07 00:34:01 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Try to update build.xml file using android tool in the project directory:

android update project --path . --target android-<api_level>
edit flag offensive delete link more
0

answered 2012-08-26 11:50:42 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

See noisecapella's very good answer to the similar question that I asked - http://answers.opencv.org/question/1545/opencv-242-android-sdk-missing-buildxml/

Copy build.xml from a sample (specifically tutorial-2-opencvcamera), only changing the project name to "opencv". Create local.properties in that directory with sdk.dir set to my SDK location. After that it worked fine

Also, edit build.xml to run the NDK build for tutorial-3 and 4, as described here: http://stackoverflow.com/questions/7432449/android-ndk-build-with-ant-script

edit flag offensive delete link more
0

answered 2012-12-14 03:59:22 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

If you believe, that this issue has been resolved, could you please accept the most appropriate answer (even if it's your own one) and close this question. It would greatly improve navigation and overall experience with OpenCV Q&A.

Thanks.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-07-06 16:18:01 -0600

Seen: 1,670 times

Last updated: Dec 14 '12