使用 JNI 时 C 文件的 eclipse 行为令人惊讶,为什么会这样?
我正在开发一个使用大量 JNI 代码的 Android 应用程序.最近(从过去的 2-3 天开始,我对 eclipse 的意外行为感到非常恼火)只要我打开我的 .c,它就会向我显示模糊的错误文件...但是,如果我关闭并重新打开项目,错误就会消失.请参阅随附的屏幕截图.是不是因为我刚刚更新了我的eclipse安装(只是更新了eclipse插件,我还在我的旧Indigo上)...
I am developing an Android App in which I use lot of JNI Code.. Recently (from last 2-3 days I am really annoyed by surprise behavior of eclipse) it shows me vague errors as soon as I open my .c file... However errors disappear if I close and reopen the project. See the secreen shot attached. Is it because I just update my eclipse installation (just update of eclipse plugins, I am still on my old Indigo)...
这是一个 eclibse 错误还是我的设置有问题?
Is it an eclibse bug or something wrong with my setup ?
解决了????我尝试了一切,但注意到可能会改变 eclipse 的行为.此时我知道我肯定错误地弄乱了项目设置,因为 eclipse 在同一工作区的其他项目中表现良好.所以我手动重新创建了项目,最终解决了我的问题......虽然问题仍然开放以获得有价值的答案,但我想我很快就会得到一些好的答案......
Solved ???? I tried everything but noting could change the behavior of eclipse.. By this time I knew that I have certainly messed with the project Settings by mistake, since eclipse was behaving well in other projects of same workspace. So I recreated the project manually and finally that solved myproblem...Though the Question is still open for valuable answers I think soon I will get some good answers..
更新即使是 eclipse 4.2 版本也有这个问题.. #frustrating
UPDATE Even eclipse 4.2 release also has this problem.. #frustrating
推荐答案
我发现删除项目然后将项目重新导入工作区可以解决问题.但是我也开始知道从项目树中删除 .cproject 文件也可以解决这个问题.修复 Eclipse 首选项中的 NDK 路径 (Window -> Preferences -> Android-> NDK) 也可以解决问题.
I found that deleting the project and than reimporting the project to workspace solves the problem. However I also came to knew that deleting .cproject file from the project tree can also fix this problem. Fixing the NDK path (Window -> Preferences -> Android-> NDK) in Eclipse preferences may also solve the problem.
解决方案 2 在少数情况下可能会起作用...
Solution 2 Which may work in few cases...
- 右键单击项目.
- 选择 Android 工具 -> 修复项目属性
相关文章