“R 无法解决"可能有错误的构建路径或库导入

quot;R cannot be resolvedquot; may have wrong build path or libraries import(“R 无法解决可能有错误的构建路径或库导入)

本文介绍了“R 无法解决"可能有错误的构建路径或库导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经问过很多次了,但相信我,我已经检查过所有问题了.大多数问题建议删除 import android.R ,删除 xml 文件中的任何错误,检查文件名(无大写字母)然后重建并清理项目或重新启动 eclipse.我已经尝试了所有但没有解决问题.当我清理所有项目时出现问题.现在所有项目都显示该错误.由于在我清理项目之前所有项目都运行良好,因此所有项目的布局或文件名不可能突然出现错误.

I know this question has been many times but trust me I have checked all. Most of the question suggests to remove import android.R , remove any error in the xml file, checking name of the files (no capital letters) then rebuild and clean the project or restart eclipse. I have tried all but none solved the problem. The problem occured when i cleaned all the projects. Now all the projects are showing that error. Since all the project were running perfectly before i cleaned projects, there is no possibility that all of the sudden the layouts or the file names of all the projects have error in them.

gen 文件夹中也没有文件.据我所知,build path 或 preferences 有问题,谁能指出我正确的方向?!

Also there is no file in gen folder. As far as i can understand there is something wrong with the build path or preferences can anyne point me in a correct direction? !

推荐答案

确保您安装了 Android 构建工具 form sdk manager

Make sure you installed the Android build tool form sdk manager

项目右键属性-> Java BuildPath 选择Library 并添加android-support.jar 按照这些步骤.

project right click properties-> Java BuildPath select Library and add android-support.jar the follow these step.

转到 Project->Properties->Java Build Path,然后选择 Order and export 选项卡.将 android-support .jar 库设置为选中并将其置于列表顶部.并清理和重建..它适用于大多数情况

Go to Project->Properties->Java Build Path than select Order and export tab. Set android-support .jar library checked and up it into top of the list. And clean and rebuild..It works for most of the cases

这篇关于“R 无法解决"可能有错误的构建路径或库导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:“R 无法解决"可能有错误的构建路径或库导入

基础教程推荐