Home » Android » android update project –path "command not found"

android update project –path "command not found"

Posted by: admin June 15, 2020 Leave a comment

Questions:

I’m trying to develop an app using OCR that runs on Android. I am following the steps in

http://gaut.am/making-an-ocr-android-app-using-tesseract/

I have passed the “ndk-build” step and advanced to the “android update project –path .” step . But it shows “android: command not found error”. I am new to android development. Can anyone please tell me how do I set path variables.

Thanks in advance.

How to&Answers:

Edit to Festus’s answer:

don’t do this: export PATH=$ANDROID_HOME/tools. this will change the entire PATH variable.

Instead use the following:

export PATH=$PATH:$ANDROID_HOME/tools

export PATH=$PATH:$ANDROID_HOME/platform-tools

This should add the path for tools and platform-tools to the existing PATH.

Answer:

If you are using mac or Linux OS

Assuming that you have set ANDROID_HOME to point to the sdk install:

export ANDROID_HOME=/Applications/android-sdks

Add Tools to PATH

export PATH=${PATH}:${ANDROID_HOME}/tools

Add platform-tools to PATH

export PATH=${PATH}:${ANDROID_HOME}/platform-tools

Answer:

Instead of using this command —> android update project -p

use this command

android.bat update project -p {project path }

Answer:

I have encountered same problem in Windows. I did it this way and it works for me .

 $ $ANDROID_SDK/sdk/tools/android.bat update project -p .
 Updated local.properties
 Updated file C:\ndk\android-ndk-r9b\samples\hello-jni\proguard-project.txt
 It seems that there are sub-projects. If you want to update them
 please use the --subprojects parameter

Here first used “cd” command to go the ndk project directory that is way I used “.”(dot) for path(-p)

$ANDROID_SDK/sdk/tools/android.bat update project -p .