1

I'm new to OpenCV on Android. Right now, I'm trying to configure it on my MacOSX.

I follow these instructions : http://www.stanford.edu/class/ee368/Android/Tutorial-2-OpenCV-for-Android-Setup-Macintosh.pdf

When I reach this step (Build JNI to the OpenCV library) using this command:

sh ./project_create.sh 

The console show this error report.

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

How to set up the target. Does it concern with local.env.mk file. If it does, this is what's inside it:

#location of android-opencv.mk file that was generated by the cmake build
#of opencv for android
OPENCV_CONFIG=../build/android-opencv.mk

#the root directory of the crystax r4 ndk - ndk-build should be in this dir
#you can download the ndk from http://www.crystax.net/android/ndk-r4.php
#ANDROID_NDK_ROOT=$(HOME)/android-ndk-r4-crystax
ANDROID_NDK_ROOT=/Users/farissyariati/android-ndk-r4-crystax/
#define only armeabi-v7a to make the final apk smaller or armeabi
ARM_TARGETS="armeabi armeabi-v7a"

Thank you.

2

3 Answers 3

2

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

Here is the solution .In the Android-jni directory type the Following command in Terminal

android update project -t 1 -p . -s

Here is a list of Build targets You can use by changing the number after -t.

Available Android targets:

id: 1 or “android-7″

Name: Android 2.1-update1

Type: Platform

API level: 7

Revision: 3

Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854

id: 2 or “android-8″

Name: Android 2.2

Type: Platform

API level: 8

Revision: 3

Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854

id: 3 or “android-10″

Name: Android 2.3.3

Type: Platform

API level: 10

Revision: 2

Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854

I was also having the same problem and it solved mine.you can also find more build targets

Hope it Helps

Sign up to request clarification or add additional context in comments.

Comments

1

Current number of target platform depends on count of downloaded SDK. Please execute the command below to ensure that you set a correct target platform:

android list target

Comments

0

I used this commands

->$Android list target:
id: 1 or "android-21"
     Name: Android 5.0
     Type: Platform
     API level: 21
     Revision: 1
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
 Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86, default/x86_64

I already set this options on the command "android update project -t 1 -p . -s" until here is all good, but when I execute ./setup_env.sh I have the same problem: Error: The project either has no target set or the target is invalid. Please provide a --target to the 'android update' command.

someone,please o/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.