R 1不能被解析为一个变量(新的Andr​​oid项目) [英] R cannot be resolved to a variable (new android project)

查看:180
本文介绍了R 1不能被解析为一个变量(新的Andr​​oid项目)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这发生了一个新的项目呢!

This happens for a new project too!

的根文件夹为空。 在activity_main.xml文件中没有错误。

The gen folder is empty. No errors in activity_main.xml file.

我曾尝试:

  • 项目 - >清除
  • 在项目 - >属性 - >检查Android版
  • 项目 - >建立
  • 重新安装Eclipse(最新)
  • 重新安装ADT插件(最新的)
  • 注释行:    的setContentView(R.layout.activity_main); 和    。getMenuInflater()膨胀(R.menu.main,菜单); 和建筑项目
  • Project->Clean
  • Project->Properties-> check android version
  • Project->Build
  • Re installing eclipse (latest)
  • Re installing ADT plugin (latest)
  • commenting lines: setContentView(R.layout.activity_main); and getMenuInflater().inflate(R.menu.main, menu); and building project

但仍是根文件夹为空! 帮助!

but still the gen folder is empty! help!

推荐答案

这解决了我的问题: <一href="http://stackoverflow.com/questions/16608524/eclipse-giving-error-missing-r-java-file-after-recent-update?lq=1">Eclipse给错误,最近更新后失踪R.java文件

This solved my problem: Eclipse giving error, missing R.java file after recent update

这是最新的ADT更新。更新之后,我们需要安装Android SDK中积累的工具。

It was the latest ADT update. After the update we need to install android sdk build-tools.

这篇关于R 1不能被解析为一个变量(新的Andr​​oid项目)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆