简体   繁体   中英

Eclipse error: invalid path for ndk?

I want to integrate some c code with Android so as first step I has to specify NDK path in Native Development node. But when I specify NDK path it gives error Invalid path for NDK I googled but could not find some solution. Am I missing some step.

SDK and NDK are in the same folder and SDK path working fine.

Please help

I have installed

  • make-3.81
  • nawk-2007.10.23-setup
  • Cygwin
  • ADT-17.0.0
  • Sequoyah
  • android-ndk-r7b-windows.zip (Extracted) 在此输入图像描述

EDIt:

I just check the link and came to know that it could be GCC absent problem .How do I check that if its GCC problem or not , or How can I check if GCC is installed or not?

Mmm... weird error. Keep in mind that in order to use the NDK, the SDK should be working in perfect way before you start with the NDK, said that, I suggest you to try the following:

1- Be sure you have the pre-requisites:

  • For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested.
  • A recent version of awk (either GNU Awk or Nawk) is also required.
  • For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations.

2- Start from scratch again by deleting any NDK references such as the settings on eclipse, paths, folders, zips, etc.

3- Be sure you have updated to the latest Android SDK and ADT Tools. Using the Help->Check for Updates Menu in ECLIPSE and then be sure you have all the things are up to date on the Android SDK Manager.

4- I see a "D:/" on your question, so you're using a Windows PC... it must be a Windows XP (32-bit) or Vista (32- or 64-bit). Be sure to get the Windows version (http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip), and when you have unzipped that ndk, rename the folder to "ndk". You can put it next to where your SDK's folder is, it should not matter.

5- Open Eclipse, and give it the path to the NDK, and see what happens.

Good luck!

I exhuasted to solve this problem "Invalid path for android SDK" but it got solved at last. Here is how it got solved. My system specs: P4 3.2 GHz, Windows 7 32-bit, Eclipse Standard Edition 4.3 (Kepler). Other supporting softwares: MinGW with GNU make 3.81.

Problem (first the problem I faced and then the solution): I downloaded Android NDK latest version from "developer.android.com/sdk/ndk/index.html" which was "android-ndk-r9-windows-x86.zip". Then I extracted it in C:\\ directory then I added a ";C:\\android-ndk-r9" in my PATH variable. Then I installed "Sequoyah Android Native Code Support" using eclipse "install new software" option (Help ➤ Install New Software➤type "Indigo - http://download.eclipse.org/releases/indigo " in the work with field ➤ go to Mobile and Device Development category and select Sequoyah Android Native Code Support). Then I went to eclipse menu "Window ➤ Preferences ➤ Android ➤ Native Development" and entered "C:\\android-ndk-r9" in the NDK location and got error " Invalid path for NDK".

Solution: I search exhaustively on internet and tried different solution but the solution worked for me was:

I downloaded the older version of NDK ( download link: "dl.google.com/android/ndk/android-ndk-r7c-windows.zip" ) and extracted in C:\\ directory using winrar and updated the PATH in environment variable to point to the new NDK version 7c. When now I entered the path it accepted. No error appeared. the problem is Sequoyah doesn't accept new version because it has not updated since 2011 ( I'm not sure) Note1: for Linux users download link: "dl.google.com/android/ndk/android-ndk-r7b-darwin-x86.tar.bz2" Note2: you can change the version in the link according to your requirement for example "dl.google.com/android/ndk/android-ndk-r4bc-windows.zip" to download version 4b. Thanks.

尝试创建一个名为“NDK”的新系统变量,并将其值设置为NDK路径。

Check your path to the NDK-- this has, on more than one occasion been the issue for me, at least with the SDK. (Not NDK in my instance) I know that, for instance, at the moment my NDK path is ~/android-ndk-r6/android-ndk-r6/

Also, to install gcc in windows, you must install Cygwin or such compatible gcc setup for windows. (The docs here say that it is required, but I think I may have heard of people using some slightly different implementation.) Cygwin works well for me, but you may need to specify gcc, make, and so on, in the installer as packages to be downloaded and set up on your machine, so read your installation options carefully. If you find that you have more packages that need to be installed, you can run the setup.exe program again and install them in-place.

In addition, here (at the bottom of the page) you can find an installation guide for the NDK in case you run into further issues.

This might sound dumb, but did you download the correct package? I had the same problem on linux until I realized I was trying to use the Windows version (I had downloaded it earlier while I was trying to install it on a different computer with cygwin). I downloaded the linux package and everything worked.

I've only been at this for a couple of days, but in my brief experience, the NDK and eclipse do not play well together. I would suggest moving to the command line for the NDK portion of the project for the time being. Some good tutorials can be found at:

http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/

http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/

Hope some file is missing in your ndk folder, so that it is unable to identify the ndk folder. Download ndk again and load it, otherwise update the native development plugin...

You said SDK and NDK are in same folder. It could be a conflict with the route. Try this:

  • Uninstall NDK
  • Reinstall NDK at D:\\ecpspace\\NDK\\android-ndk-r7b
  • Create new PATH on enviroment var
  • Restart computer

On linux work for me, i had 2 ndks installed in different routes, and when i used eclipse, was compiling using the other one, and don't worked as i wanted.

I have similar bug (Eclipse Version: Indigo Service Release 2, Build id: 20120216-1857). The main problem was in Sequoya plug-in. Problem disappear when I update Sequoya to the latest version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM