简体   繁体   English

Eclipse错误:ndk的路径无效?

[英]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. 我想将一些c代码与Android集成,因此第一步我必须在Native Development节点中指定NDK路径。 But when I specify NDK path it gives error Invalid path for NDK I googled but could not find some solution. 但是,当我指定NDK路径时,它会给出错误NDK的无效路径我用Google搜索但无法找到解决方法。 Am I missing some step. 我错过了一些步骤。

SDK and NDK are in the same folder and SDK path working fine. SDKNDK在同一个文件夹和SDK路径下工作正常。

Please help 请帮忙

I have installed 我安装了

  • make-3.81 使-3.81
  • nawk-2007.10.23-setup NAWK - 2007年10月23日 - 设置
  • Cygwin Cygwin的
  • ADT-17.0.0 ADT-17.0.0
  • Sequoyah 塞阔亚
  • android-ndk-r7b-windows.zip (Extracted) android-ndk-r7b-windows.zip(摘录) 在此输入图像描述

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? 我只是查看了链接并且知道它可能是GCC缺席的问题。如何检查是否存在GCC问题,或者我如何检查是否安装了GCC?

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: 请记住,为了使用NDK,在开始使用NDK之前,SDK应该以完美的方式工作,说,我建议你尝试以下方法:

1- Be sure you have the pre-requisites: 1-确保您有先决条件:

  • For all development platforms, GNU Make 3.81 or later is required. 对于所有开发平台,都需要GNU Make 3.81或更高版本。 Earlier versions of GNU Make might work but have not been tested. 早期版本的GNU Make可能有效,但尚未经过测试。
  • A recent version of awk (either GNU Awk or Nawk) is also required. 最新版本的awk(GNU Awk或Nawk)也是必需的。
  • For Windows, Cygwin 1.7 or higher is required. 对于Windows,需要Cygwin 1.7或更高版本。 The NDK will not work with Cygwin 1.5 installations. NDK不适用于Cygwin 1.5安装。

2- Start from scratch again by deleting any NDK references such as the settings on eclipse, paths, folders, zips, etc. 2-通过删除任何NDK引用(例如eclipse,路径,文件夹,拉链等设置)再次从头开始。

3- Be sure you have updated to the latest Android SDK and ADT Tools. 3-确保您已更新到最新的Android SDK和ADT工具。 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. 使用ECLIPSE中的帮助 - >检查更新菜单,然后确保Android SDK管理器上的所有内容都是最新的。

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). 4-我在你的问题上看到“D:/”,所以你使用的是Windows PC ......它必须是Windows XP(32位)或Vista(32位或64位)。 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". 请务必获取Windows版本(http://dl.google.com/android/ndk/android-ndk-r7b-windows.zip),并在解压缩该ndk后,将该文件夹重命名为“ndk”。 You can put it next to where your SDK's folder is, it should not matter. 您可以将它放在SDK文件夹的旁边,这应该没关系。

5- Open Eclipse, and give it the path to the NDK, and see what happens. 5-打开Eclipse,并为它提供NDK的路径,看看会发生什么。

Good luck! 祝好运!

I exhuasted to solve this problem "Invalid path for android SDK" but it got solved at last. 我解雇了解决这个问题“Android SDK的无效路径”但它终于解决了。 Here is how it got solved. 这是如何解决的。 My system specs: P4 3.2 GHz, Windows 7 32-bit, Eclipse Standard Edition 4.3 (Kepler). 我的系统规格:P4 3.2 GHz,Windows 7 32位,Eclipse标准版4.3(开普勒)。 Other supporting softwares: MinGW with GNU make 3.81. 其他支持软件: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". 问题(首先是我面临的问题,然后是解决方案):我从“developer.android.com/sdk/ndk/index.html”下载了Android NDK最新版本,这是“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. 然后我在C:\\目录中解压缩它然后在我的PATH变量中添加了一个“; C:\\ android-ndk-r9”。 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). 然后我使用eclipse“安装新软件”选项安装了“Sequoyah Android Native Code Support”(帮助➤安装新软件➤类型“Indigo - http://download.eclipse.org/releases/indigo ”, 使用字段➤去移动和设备开发类别和选择Sequoyah Android本机代码支持)。 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". 然后我进入日食菜单“窗口➤首选项➤Android➤本机开发”并在NDK位置输入“C:\\ android-ndk-r9”并收到错误“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. 我下载了旧版本的NDK(下载链接:“dl.google.com/android/ndk/android-ndk-r7c-windows.zip”)并使用winrar在C:\\目录中解压缩并更新了环境变量中的PATH指向新的NDK版本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. 问题是Sequoyah不接受新版本,因为它自2011年以来没有更新(我不确定)注1:对于Linux用户下载链接:“dl.google.com/android/ndk/android-ndk-r7b-darwin -x86.tar.bz2“注意2:您可以根据您的要求更改链接中的版本,例如”dl.google.com/android/ndk/android-ndk-r4bc-windows.zip“以下载版本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. 检查你的NDK路径 - 这对我来说不止一次是问题,至少在SDK上。 (Not NDK in my instance) I know that, for instance, at the moment my NDK path is ~/android-ndk-r6/android-ndk-r6/ (在我的实例中不是NDK)我知道,例如,目前我的NDK路径是〜/ android-ndk-r6 / android-ndk-r6 /

Also, to install gcc in windows, you must install Cygwin or such compatible gcc setup for windows. 另外,要在Windows中安装gcc,必须为Windows安装Cygwin或此类兼容的gcc设置。 (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. 这里的文档说它是必需的,但我想我可能听说过人们使用了一些稍微不同的实现。)Cygwin对我很有用,但你可能需要在安装程序中指定gcc,make等等。要在您的机器上下载和设置的软件包,请仔细阅读您的安装选项。 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. 如果您发现需要安装更多软件包,则可以再次运行setup.exe程序并将其安装到位。

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. 此外, 在这里 (在页面底部),您可以找到NDK的安装指南,以防您遇到其他问题。

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). 我在linux上遇到了同样的问题,直到我意识到我正在尝试使用Windows版本(我之前尝试使用cygwin在不同的计算机上安装它时我已经下载了它)。 I downloaded the linux package and everything worked. 我下载了linux软件包,一切正常。

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. 我只是在这里待了几天,但根据我的简短经验,NDK和日食不能很好地融合在一起。 I would suggest moving to the command line for the NDK portion of the project for the time being. 我建议暂时转移到项目的NDK部分的命令行。 Some good tutorials can be found at: 一些很好的教程可以在以下位置找到:

http://www.cmumobileapps.com/2011/08/31/compiling-open-source-libraries-with-android-ndk-part-1/ 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/ 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. 希望你的ndk文件夹中缺少某些文件,因此它无法识别ndk文件夹。 Download ndk again and load it, otherwise update the native development plugin... 再次下载ndk并加载它,否则更新本机开发插件...

You said SDK and NDK are in same folder. 你说SDK和NDK在同一个文件夹中。 It could be a conflict with the route. 这可能与路线发生冲突。 Try this: 尝试这个:

  • Uninstall NDK 卸载NDK
  • Reinstall NDK at D:\\ecpspace\\NDK\\android-ndk-r7b 在D:\\ ecpspace \\ NDK \\ android-ndk-r7b重新安装NDK
  • Create new PATH on enviroment var 在enviroment var上创建新的PATH
  • 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. 在linux上为我工作,我在不同的路由中安装了2个ndks,当我使用eclipse时,正在使用另一个编译,并且不按我想要的方式工作。

I have similar bug (Eclipse Version: Indigo Service Release 2, Build id: 20120216-1857). 我有类似的错误(Eclipse版本:Indigo Service Release 2,Build id:20120216-1857)。 The main problem was in Sequoya plug-in. 主要问题是Sequoya插件。 Problem disappear when I update Sequoya to the latest version. 当我将Sequoya更新到最新版本时,问题就消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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