简体   繁体   English

SDK和ADT更新后,Android R.java无法在Eclipse中重新生成

[英]Android R.java doesn't regenerate in Eclipse after SDK & ADT update

I have recently downloaded both the 2.3 and 3.0 SDK for Android using Eclipse. 我最近使用Eclipse下载了Android的2.3和3.0 SDK。

I have also updated the ADT plug-in to 10.0.0. 我还将ADT插件更新为10.0.0。

However since doing this the R.java file in my project will not regenerate at all, I have tried every solution on the web that google can give me and none of them work. 但是,由于这样做我的项目中的R.java文件根本不会重新生成,因此我尝试了Google可以给我的所有网络解决方案,但都无济于事。

So I imported my project to a different machine that only has the 2.2 SDK and an older ADT plugin installed and the R.java file regenerates fine on that machine. 因此,我将项目导入到另一台仅安装了2.2 SDK和较旧的ADT插件的计算机上,并且R.java文件在该计算机上可以重新生成。

Currently on my work machine I am trying to add a png to drawables but the R.java doesn't seem to pick it up meaning I cant use it in my project. 当前,在我的工作机上,我正在尝试向drawables添加png,但是R.java似乎没有选择它,这意味着我不能在项目中使用它。

Is there something stupid that I'm missing that I should have done when I upgraded the SDK and ADT? 升级SDK和ADT时,我应该缺少一些愚蠢的东西吗?

EDIT: R.java simply wont rebuild at all, even if I change my XML. 编辑:即使我更改XML,R.java也根本不会重建。

The issue is definitely with the 2.3 SDK or ADT 10, it works fine if I have 2.2 and ADT 9 问题绝对是2.3 SDK或ADT 10,如果我有2.2和ADT 9,它就可以正常工作

I recently had this problem as well. 我最近也有这个问题。 In my case I had type-o in one of my resource xml config files. 就我而言,我在一个资源xml配置文件中输入了-o。 This error caused the resource builder to terminate and my R.java was never built. 此错误导致资源生成器终止,并且从未构建我的R.java。 I tried to delete it first to trigger a rebuild but that did not work. 我尝试先将其删除以触发重建,但是那没有用。

I temporarily removed the resource file causing the error and then did Project -> Clean and the R.java was correctly built again. 我暂时删除了导致错误的资源文件,然后执行了Project-> Clean并再次正确构建了R.java。

Not sure if will help, but it might get you going in the right direction. 不确定是否会有所帮助,但它可能使您朝正确的方向前进。

Its a bug within ADT r14 and it isnt really fixed with r15 or r14. 它是ADT r14中的一个错误,实际上并没有用r15或r14修复。 Only thing I can think is to unistall and redownload the older ver 13 and keep using the code from there. 我唯一能想到的就是取消安装并重新下载较旧的版本13,并继续从那里使用代码。

try to clean and Build workspace from eclipse=>project->clean. 尝试从eclipse => project-> clean清理并构建工作区。

me done this it work for me.. 我为我完成了这项工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM