1

I'm following tutorial on http://www.stanford.edu/class/ee368/Android/Tutorial-2-OpenCV-for-Android-Setup-Linux.pdf

But when it comes to: sh ./project_create.sh in the android-jni folder, I get this error :

Error: The project either has no target set or the target is invalid.
Please provide a --target to the 'android update' command.

The contents of the project_create.sh file are

#!/bin/sh
#this generates an ant based cli build of the android-jni project

android update project --name android-opencv \
--path .

2 Answers 2

1

Add --target=android-8 (or any other reported by the android list target -c command) to the command line. android-8 is the minimal required by OpenCV.

Also, the tutorial is deprecated and android-opencv example were removed from OpenCV before the 2.3.1 release.

2
  • i tried giving target as android-8,but now it says: android: command not found.It is most erratic that it has started giving this error now.Even simply typing android at command line gives this error.The android-sdk is properly installed . Mar 7, 2012 at 19:15
  • Just tried (2014), --target=android-19 did not work but --target android-19 worked. I guess the syntax changes from equals to space. May 15, 2014 at 8:08
0

Please open your terminal, then go to home (cd ~), then type gedit .profile then add following lines at the end of file.

 export NDK=/home/JohnDoe/android-ndk-r4-crystax
 export SDK=/home/JohnDoe/android-sdk-linux
 export ANT_HOME=/home/JohnDoe/apache-ant-1.8.3
 export JAVA_HOME=/home/JohnDoe/jdk1.7.0_03
 export OPCV=/home/JohnDoe/opencv
 export PATH=$NDK:$SDK/tools:$SDK/platform-tools:$ANT_HOME/bin:$JAVA_HOME/bin:$PATH

(Please don't forget to change NDK, SDK etc paths accordingl to your setup).

I faced the same problem while using the Stanford tutorial, and solved it using above way.

Regards

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.