R无法解析为变量(新的android项目) [英] R cannot be resolved to a variable (new android project)

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

问题描述

这也是一个新的项目!



gen文件夹是空的。
在activity_main.xml文件中没有错误。



我尝试过:




  • 项目 - >清洁

  • 项目 - >属性 - >检查android版本

  • 项目 - >构建

  • 重新安装eclipse(最新)

  • 重新安装ADT插件(最新)

  • 注释行:
    setContentView(R.layout .activity_main);

    getMenuInflater()。inflate(R.menu.main,menu);
    和建筑项目



但仍然是gen文件夹是空的!
help!

解决方案

这解决了我的问题:


这是最新的ADT更新。更新后,我们需要安装android sdk build-tools。


This happens for a new project too!

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

I have tried:

  • 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!

解决方案

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

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

这篇关于R无法解析为变量(新的android项目)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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