window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
来源:互联网 发布:淘宝官方amp服务商 编辑:程序博客网 时间:2024/05/21 22:07
最近需要用到android的ndk,但是在eclipse中,一直提示Method 'NewStringUTF' could not be resolved(方法“NewStringUTF”无法被解析)。可问题是,jni.h等一系列的依赖库,都已经导入了,并且也能正常的使用build来编译出动态库文件。但是无奈的就是eclipse的cdt,仍旧会不停的提示这类的错误,导致整个项目没办法编译过去。
后来,我先问了baidu,然后又问了google,最终折腾了半天也没很好解决这个问题的办法。
最后还是让我在这里找到了答案:
http://stackoverflow.com/questions/15899813/eclipse-method-newstringutf-could-no
原文如下:
I had this issue. Based on my "solution," it seems to be something funny going on in Eclipse, since I had another project open with (as far as I was able to tell) the exact some properties, paths, etc., besides for being labeled a Library Project.Just by observing the corresponding struct in jhi.h, the callback prototypes are all there! Ctrl-click the include statement and Eclipse will even link you the reference!Go to the project's Properties -> C/C++ General -> Code Analysis. Click the "Use project settings" radio button (or "Configure Workspace Settings..." button). Disable (uncheck) the "Method cannot be resolved" checkbox. Click "Apply," "OK." Then for your project, refresh, clean, refresh, build.There must have been something I did differently in creating the new project. Or maybe it was because of the locations of the projects, or the fact that the previous was a Library. Maybe it really is an Eclipse bug? For reference, I'm using ADT v21.1.0-569685 and NDK r8e for Windows。
具体操作如下:
Go to the project's Properties -> C/C++ General -> Code Analysis. Click the "Use project settings" radio button (or "Configure Workspace Settings..." button). Disable (uncheck) the "Method cannot be resolved" checkbox. Click "Apply," "OK." Then for your project, refresh, clean, refresh, build.<span style="font-family:SimSun;font-size:14px;"></span>
项目右键->属性->c/c++常规->Code Analysis,选择"Use project settings" 中的方法无法被解析(Method cannot be resolved)取消选择,应用->确定,然后刷新、清理、刷新、build项目。
搞定。
2 4
- window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- 解决NDK开发中的 Method 'NewStringUTF' could not be resolved
- 解决NDK开发中的 Method 'NewStringUTF' could not be resolved
- 解决NDK开发中的 Method 'NewStringUTF' could not be resolved
- Eclipse - Method NewStringUTF() could not be resolved
- 【android】解决NDK开发中的 Method 'NewStringUTF' could not be resolved
- Method 'NewStringUTF' could not be resolved
- Method 'NewStringUTF' could not be resolved
- Android: Type Method 'NewStringUTF' could not be resolved
- Android NDK开发method GetStringUTFChars’could not be resolved
- Android NDK开发method GetStringUTFChars’could not be resolved
- Android: Type Method 'NewStringUTF' could not be resolved 的完美解决
- android ndk 开发流程以及“Method could not be resolved”的解决办法,代码提示
- 学习点滴(二)
- NodeJs
- 一个简单的工程来理解android工作(-)
- 1642 - Magical GCD (数论)
- tableview小结
- window平台下 Eclipse Ndk开发中的Method 'NewStringUTF' could not be resolved问题
- c语言socket通信
- java.util.prefs.WindowsPreferences <init>异常警告
- 简单几步在eclipse集成环境中代码显示行号
- 浅学设计模式--单例模式
- jni/../../Classes/AppDelegate.cpp:29: error: undefined reference to
- OpenCV 3.0.0 alpha compile by gcc cmake
- Node.js操作mongodb数据库
- The method getTextContent() is undefined for the type Node