I am using ubuntu and trying to build a project and I am using the following code:
cd <project-directory>/tess-two
ndk-build
android update project --path .
ant release
When I type ndk-build it returns command not found. It returns command not found.I extracted the ndk bin file and made it a folder. Please help me out.
You need add ndk-build directory to PATH. For example: if your ndk is in directory /opt/android-ndk-r10d, run this command first
export PATH=$PATH:/opt/android-ndk-r10d
You'd better add the command to ~/.bashrc if you don't want to run this command later.
Related
I am using ubuntu and am trying to build a project. I am using the following code:
cd tess
cd tess-two
ndk-build
android update project --path .
ant release
When I type (android update project --path) it returns (android:command not found). The ndk-build was successful.Please help me out.
The command android is a tool under the Android SDK tools directory. You didn't add the path to your %path% (Windows) or PATH (*NIX), so the command not found.
You should install Android SDK firstly, then
For Windows, add %android_sdk%\tools to %path%
For *NIX, add $ANDROID_SDK/tools to PATH
I am currently attempting to build tess-two for an OCR android application via command line as instructed on https://github.com/rmtheis/tess-two. This is done on my macbook, OSX 10.9.4.
In order to build tess-two, this must be typed into command line:
$ 1git clone git://github.com/rmtheis/tess-two tess
$ cd tess
$ cd tess-two
$ ndk-build
$ android update project --path .
$ ant release
I encountered a problem as soon as I enter:
$ android update project --path .
This is the error displayed:
-bash: android: command not found
I have spend many hours trying to remedy this, and so far nothing fruitful has come of it. I appreciate any suggestions. Thanks.
This means the android command is not in your PATH. Try typing which android. It should give you the location if it is within your PATH.
Usually android can be found in your SDK directory under tools
You've got two options:
run the command with your_sdk_path/tools/android update project --paht
add android to your PATH with
export PATH=$PATH:/your_sdk_path/tools
You must have downloaded Android Development Toolkit bundle first. https://developer.android.com/sdk/index.html?hl=sk#mac-bundle
Then add /sdk/tools to your path.
I hope you know how to configure your path. If you are not sure please have a look at this : http://www.cyberciti.biz/faq/appleosx-bash-unix-change-set-path-environment-variable/
I have been trying to get my head around using uiautomator and I understand creating the test cases. I tried the first two steps of building the JAR according the the Android developer guide for UI Testing (http://developer.android.com/tools/testing/testing_ui.html) and that worked fine, but I am unsure on how to follow the next steps and building the JAR file with ant. Please can anyone help me with this issue.
Here are the steps that I have done so far:
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
set ANDROID_HOME=<path_to_your_sdk>
This is the step that I am stuck on:
ant build
The error I get when I use the command prompt is:
'ant' is not recognized as an internal or external command, operable program or batch file.
In the terminal run
which ant
It seems you do not have ant installed. If no location like /usr/bin/ant shows up after you run the command above, use this to install it:
sudo apt-get install ant
Try again after. It should work.
If you're using ADT, I recommend downloading Apache ant and placing it within the sdk/tools/ant folder. Then change your PATH variable to direct to the ant bin folder.
you have this error because you wrote "ant build" from incorrect path.
I did (this command generate build.xml, local.properties, project.properties files):
<android-sdk>/tools/android create uitest-project -n <name> -t 1 -p <path>
I changed in build.xml first line like:
<project name="name" default="build">
after that I run ant from eclipse. Build was success.
Have you installed ant? If not then do it from this site: http://ant.apache.org/manual/install.html
If yes then follow these steps:
Navigate to your project directory and means (go to bin of your project)
Using command window execute the function: ant build
Ensure that your default JAVA_HOME points to JDK installation, not the JRE, and check if your compiler is in the PATH. Try to type “javac” in the command prompt. If javac is not found, then you should put your bin directory in the PATH.
For example, in Windows:
SET PATH=c:/jdk1.5.0_07/bin;%PATH%
This site might help further: http://looksok.wordpress.com/2014/02/08/uiautomator-in-eclipse/
If you have ADT with Eclipse then you can find ant in the plugins directory of Eclipse.
I am using Ant to build my application.my app uses a library project.so first of all i had run the below command in commandline to generate the build.xml in my project.
"android update
project --target 5 -p path_of_my_project -l path_of_my_library_project"
(my application's build target is 4.0).Above command generated a build.xml file in my project.Then i run "ant" command in command prompt.it has shown the result as BUILD SUCCESSFULL. but when i checked my project's bin folder there is no apk file is generated.what is the issue?I did not make any changes in build.xml file.do i need to add something to that to generate the build?please guide me.
This is probably a very easy question but since I am new to Cygwin and Ant, this annoyed me a lot.
Basically, I am trying to test hello-jni example that comes with NDK ( I use r8 currently).
I have set my paths and everything is working fine. However, when I simply cd to the sample directory and try to update the project, I get the following error.
Same error pops up when I actually append the path after -p
$ android.bat update project -p .
Error: The project either has no target set or the target is invalid.
Please provide a --target to the 'android.bat update' command.
ndk-build is working fine but whenever I try to install using Ant, I get the build.xml is missing error inevitably.
Thanks.
run this command
android update project -p . -s --target android-14