Unable to launch cygpath in android - android

When i am trying to import a project to my workspace it shows an error
[2013-03-17 16:14:15 - Unable to launch cygpath. Is Cygwin on the
path?] java.io.IOException: Cannot run program "cygpath":
CreateProcess error=2, The system cannot find the file specified
this project contains jni libraries,it is a ndk based project.why this error happen i cant import this project to my system.

go to your project right click there.then take properties and select the c/c++ build and there you can see the build settings .and in the build settings give the path of ndk in your system like:
D:\android\android-ndk-r8d\ndk-build.cmd NDK_DEBUG=1
Now clean your project and run. Thats it.

With NDK r8d, you don't need cygwin. Maybe the project you import was tuned for an older version, and maybe it defined ndk-build.sh as the C++ build command. You should use ndk-build.cmd or simply ndk-build (utilizing Windows command line conventions)

You can set an environment variable
NDK_HOME = [your path to ndk]

Related

ndk-build.cmd isn't recognized as internal or external command

I'm working on OpenCV library in android studio.I'm using 2.2.1 version of android studio. Problem is that when I run ndk-build.cmd on command prompt, debugger shows that it is not recognised command,operable program or batch file.
when I build my project it gives error, that is:
" Error:(120) *** Android NDK: Aborting. Stop."
I also have tried to build project without importing OpenCV library as I was following a tutorial, but it also give error.
"Error:Execution failed for task ':app:compileDebugNdk'.
Error: Your project contains C++ files but it is not using a supported native build system.
Consider using CMake or ndk-build integration with the stable Android Gradle plugin:
https://developer.android.com/studio/projects/add-native-code.html
or use the experimental plugin:
http://tools.android.com/tech-docs/new-build-system/gradle-experimental."
Even I download CMake and NDK tools but still this error exists. Please guide me to solve this problem.
Thanks in advance.
To run ndk-build
1)you have to add its path in your Enviroment Variable so yo can access it from anywhere with just "ndk-build.cmd"
or
2) you have to give full ndk path like E:\sdk\ndk-bundle\ndk-build.cmd if you have windows
To run ndk-build from command prompt, you can provide the full path to the script, e.g.
C:\> d:\android\ndk\ndk-build.cmd
It is important to install ndk to a directory with no spaces in its full path, e.g.
d:\android SDK\ndk r13
won't work. Avoid spaces in the path to your project, too. Android Studio will not be happy to build
e:\my projects\android apps\ndk sample\build\outputs\apk\my first ndk app.apk

How to import min3D in Android Studio?

I have tried Import into Subversion but it showing error.
Cannot import to svn: Cannot run program "svn": CreateProcess error=2, The system cannot find the file specified.
Check this tutorials. This would help. I believe you were following this earlier.
Basically, create a golder named min3d, under the folder named Java from your project structure, and copy the source you had downloaded into the created mind3d folder.
Then right click - > add as reference/library. This should fix it.
Cannot run program "svn" <- this looks like you have to install SVN
you can optain it from: http://tortoisesvn.net/
Or verify that you are able to open SVN from command-shell:
Open a shell and type: svn --help
In case you get an error stating, that svn could not be found, you have to
set your path environment var.
The PATH is the system variable that your operating system uses to
locate needed executables from the command line or Terminal window.
(SVN) Subversion is a source version control system (VCS). Subversion
manages files and directories, and the changes made to them, over
time. This allows you to mange and recover diffent stages of your
development process.

Android NDK Installation with imported project

I imported an Android project in eclipse ADT and it needs the Android NDK to work. I downloaded and configured the NDK in Window > Preferences and made a few configurations in the project properties from other stackoverflow sources but the project has build errors and is just NOT working....
**** Build of configuration Default for project GLTexture ****
\ndk-build all
Cannot run program "\ndk-build": Launching failed
Error: Program "/ndk-build" is not found in PATH
PATH=[C:/Program Files/Java/jre7/bin/client;C:/Program
Files/Java/jre7/bin;C:/ProgramFiles/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Users\Abbas\AppData\Roaming\npm;C:\IDEs\adt-bundle-windows-x86-20130219\adt-bundle-windows-x86-20130219\eclipse;]
**** Build Finished ****
Any help would be appreciated thanks!
This error means it can't find the ndk-build command, which is located in the top level folder of the NDK install. Double check the value you set in Window -> Preferences -> Android -> NDK. I have mine set to I:\ADT\android-ndk-r9 and in that folder is the ndk-build and ndk-build.cmd scripts used by eclipse. Note that this value is per workspace, so if you 've changed workspaces since you've set the ndk path you will need to re-enter it. Also, right click on your project, select properties, and under C/C++ Build your Build command should be exactly ndk-build with optional arguments.
Note that it is NOT required to have the NDK in your system path. I just confirmed this by removing it from my path (its needed in path if you build from command line), restarting eclipse and rebuilding the project. But note that you can run ndk-build from the command line in your project folder if the NDK is in your path.

Android NDK in ADT and Mac OS (10.8): Cannot run program "/ndk-build": Unknown reason Error: Program "/ndk-build" is not found in PATH

The error while building is
/ndk-build
Cannot run program "/ndk-build": Unknown reason
Error: Program "/ndk-build" is not found in PATH
PATH=[/usr/bin:/bin:/usr/sbin:/sbin]
I am trying to build a OpenCV project on Eclipse ADT and have done the following so far to build it.
Normal android projects(not involving c/c++ code) works fine.
1- I have edited the /etc/paths to the following
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/tools
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/platfor
m-tools
PATH=$PATH:/Users/mohitagrawal/android-ndk-r8e
2- I have edited $PATH to following(knowingly or unknowingly)
-bash: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/tools:PATH=$PATH:/Users/mohitagrawal/adt-bundle-mac-x86_64-20130219/sdk/platfor:m-tools:
PATH=$PATH:/Users/mohitagrawal/android-ndk-r8e:/opt/X11/bin:/usr/local/git/bin:/usr/texbin: No such file or directory
3- Build command in "C/C++ Build" in project properties is set to
${NDK_ROOT}/ndk-build
4- NDK location in Preferences of ADT eclipse is set to
/Users/mohitagrawal/android-ndk-r8e
Please help me. I am stuck from many days and has even tried on different platform.
You need to change the PATH in Eclipse since it is Eclipse that is trying to run the command. Go to Project Properties > C/C++ Build > Environment > PATH
Add the path to your ndk directory in the PATH variable (i.e. add /Users/mohitagrawal/android-ndk-r8e to the PATH variable).
Moreover, it apparently tries to run /ndk-build. Make sure that in Project Properties > C/C++ Build, "Build command" is ndk-build and not /ndk-build
EDIT: you can also try to build your project from the terminal, by navigating to your project and running the command ndk-build.
I've tried all the solutions that I could find on stackoverflow and none of them worked.
In the end I've found this blog.
I'll post the solution here as the link may break in the future:
1. Open up Terminal.
2. Run the following command: sudo nano /etc/paths
3. Enter your password, when prompted.
4. Go to the bottom of the file, and enter the path you wish to add.
5. Hit control-x to quit.
6. Enter "Y" to save the modified buffer.

Ant Build Android Project With Dependencies

I'm trying to build an app (let's call it android-app) with a dependency on an SDK (let's call it sdk) via Ant. Eclipse is not installed on this computer (for reasoning, it's a CI box with Jenkins).
Both projects are in two completely separate directories side by side. android-app is in the directory ~/.jenkins/jobs/android-app/workspace and sdk is in the directory ~/.jenkins/jobs/sdk/workspace.
Let's assume both projects are "vanilla" and have not been built with Ant before. I cd to the ../android-app/workspace directory and run android update project -p . --library ~/.jenkins/jobs/sdk/workspace which passes. I then cd to the ../sdk/workspace directory and run android update project -p . which also passes.
At this point I cd back to the ../android-app/workspace directory and run ant clean build. It fails with the error:
BUILD FAILED
/path/to/ant/build.xml:440:
/path/to/sdk/workspace resolve to a path with no project.properties file for
project /path/to/android-app/workspace
... where /path/to is the full path to the directories. I simplified it here.
If I cd to the sdk workspace and open project.properties, I receive the following:
# ProGuard
proguard.config=proguard.cfg
# Project target.
target=android-10
android.library=true
It does exist. So do all of these files:
So, why is this failing? What am I doing wrong? I tried to provide as many details as possible. Please let me know if I can provide anything additional.
Well, I encounter this problem too.
I use strace to find out what the hell is going on and found that the path you specified in project.properties will be appended with your current folder path as its prefix.
For example,
/home/myfolder/project > ant debug
And the library you specified in project.properties is /path/to/library
Then, the path will become
/home/myfolder/project/path/to/library
Just to fill in the answer gap here, my Java version was completely off. I'm super embarrassed.

Categories

Resources