Android: Type Method 'NewStringUTF' could not be resolved

 

 
编译一个最简单的Android NDK 例子(android-ndk-r8/samples/hello-jni)出现了错误信息:Type Method 'NewStringUTF' could not be resolved。搜索了网上说的方法感觉不是很靠谱。自己试了一下居然解决了 --- 很弱智的方法。
首先,错误信息如下:
Android: Type Method NewStringUTF could not be resolved - 携子之手 - 嵌入式软件设计
 
其次,我发现这个错误仅仅在Eclipse打开c代码窗口时才出现。此时运行应用程序会出现下面的错误:
Android: Type Method NewStringUTF could not be resolved - 携子之手 - 嵌入式软件设计
 
将错误删除,并关闭C代码窗口。
Android: Type Method NewStringUTF could not be resolved - 携子之手 - 嵌入式软件设计

"Clean"之后,重新编译工程,一切正常。
 
Android: Type Method NewStringUTF could not be resolved - 携子之手 - 嵌入式软件设计
 
看起来这是官网上Eclipse版本支持NDK时的一个bug。后续会持续关注。
原文地址:https://www.cnblogs.com/sopic/p/4899010.html