[英]Invalid path for Android NDK in Eclipse Preferences
I'm looking to incorporate the NDK for C++ code use in my Android project. 我希望在我的Android项目中纳入C ++代码使用的NDK。 I'm using Eclipse Android IDE and I've just downloaded android-ndk-r9-darwin-x86_64.tar.bz2 for OSX 64bit.
我正在使用Eclipse Android IDE,并且刚刚下载了适用于OSX 64位的android-ndk-r9-darwin-x86_64.tar.bz2。 I've uncompressed the ndk and have it in my home folder, but when I attempt to setup the path inside Eclipse prefs, I get this error
我已经解压了ndk并将其保存在主文件夹中,但是当我尝试在Eclipse prefs中设置路径时,出现此错误
I've looked at this similar question ( Eclipse error: invalid path for ndk? ) for answers, but every suggestion didn't solve the problem. 我已经看过这个类似的问题( Eclipse错误:ndk的路径无效? ),但是每个建议都不能解决问题。 Other relevant information, I have Make 3.8.1, up-to-date SDK, Sequoyah.
其他相关信息,我拥有最新的Make 3.8.1 SDK(Sequoyah)。
I had the same problem and documented the solution to this problem. 我遇到了同样的问题,并记录了解决该问题的方法。 It are the first 2 steps of the next link you'll need: http://aplacetogeek.wordpress.com/android-with-opencl-tutorial/
这是您需要的下一个链接的前两个步骤: http : //aplacetogeek.wordpress.com/android-with-opencl-tutorial/
Edit: 编辑:
The solution is this: 解决方法是这样的:
Step 1: setup Android NDK 步骤1:设定Android NDK
/home/dries/AndroidDev/adt-bundle-linux-x86_64-20131030/android-ndk-r9c
/home/dries/AndroidDev/adt-bundle-linux-x86_64-20131030/android-ndk-r9c
Step 2: configure Android NDK for your project 步骤2:为您的项目配置Android NDK
Go to project -> properties -> C/C++ build -> build variables -> add 转到项目->属性-> C / C ++构建->构建变量->添加
Name: NDKROOT
名称:NDKROOT
Value: your android-ndk-r9c folder you also added to NDK in step 1.
值:您在步骤1中也添加到NDK的android-ndk-r9c文件夹。
Click Ok 点击确定
${NDKROOT}/ndk-build
. ${NDKROOT}/ndk-build
。 Make sure you did not end the NDKROOT value on / ! You should be able to use the NDK now and compile without errors. 您现在应该可以使用NDK并进行编译而不会出现错误。
Found a work-around solution to my question with the help from this forum: https://groups.google.com/forum/#!topic/android-ndk/YPFPa9Fen7Y 在以下论坛的帮助下,找到了解决我问题的解决方案: https : //groups.google.com/forum/#!topic/android- ndk/ YPFPa9Fen7Y
I downloaded an old copy of the NDK (r5b) and there were no errors when setting up the path, as opposed to r9 the most recent version. 我下载了NDK(r5b)的旧副本,并且与最新版本的r9相比,设置路径时没有错误。 As the forum says, the problem lies with Sequoyah which has not updated since 2011 and can not recognize the new structure of that the NDK is laid out in. Hope this helps someone in the future.
正如论坛所言,问题在于Sequoyah,自2011年以来未进行更新,并且无法识别NDK所采用的新结构。希望这对将来有所帮助。 (If you find a direct solution though, let me know.)
(不过,如果您找到直接的解决方案,请告诉我。)
Instead of downloading another version of the NDK, I simply created links inside the build
folder to the toolchains
, prebuilt
and platforms
which recreates the folder hierarchy of the r4 NDK. 无需下载NDK的另一个版本,我只是在
build
文件夹内创建了到toolchains
, prebuilt
和platforms
链接,这些链接重新创建了r4 NDK的文件夹层次结构。
Doing this made the plugin happy, and I only have one version of the NDK on my computer. 这样做使插件感到高兴,并且我的计算机上只有一个版本的NDK。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.