导入R.(android) [英] importing R. (android)

查看:152
本文介绍了导入R.(android)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索了Stack Overflow,因为我知道这是一个常见的问题,但没有一个解决方案对我有用。这包括清理我的项目,删除所有导入并删除项目并完全重新开始。

I have searched through Stack Overflow as I know this is a common question, but none of the solutions seemed to work for me. This included cleaning my project, deleting all imports and deleting the project and starting again entirely.

我正在使用专门用于Android的Eclipse(ADT捆绑软件)。

I am using the Eclipse specifically for android on mac (ADT bundle mac).

每当我创建一个新项目时,我在我的src文件夹中的错误就是
setContentView(R.layout.activity_main);

Whenever I create a new project I have errors immediatley in my src folder on the line setContentView(R.layout.activity_main);

以及充气。

除了上述建议之外的任何建议?这是在我完成任何编程之前,所以无法理解错误。

Any suggestions other than those stated? It is literally before I have done any programming so cannot understand what is wrong.

编辑:修正。第二次下载SDK,这似乎修复了它。

Fixed. Downloaded the SDK a second time and this seems to have fixed it.

推荐答案

将项目构建目标更改为最新

Change your Project Build Target to the Latest

右键单击项目>属性> Android>将Api更改为最新版本

Right Click Project > Properties > Android > Change the Api to latest version

这篇关于导入R.(android)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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