---
title: "android生成R.java文件"
author: "winse"
date: "2012-07-13T16:02:16Z"
tags: []
categories: ["编程语言"]
slug: "android-r-java"
draft: false
lastmod: "2012-07-13T16:03:16Z"
id: 1591363
url: "https://winse.iteye.com/blog/1591363"
---

eclipse生成R.java文件：

保存后工程rebuild，最终调用android-sdk-windows\\platform-tools\\aapt.exe执行命令来生成文件，然后刷新eclipse-project的gen目录。

 

```
#com.android.ide.eclipse.adt.internal.build.builders.PreCompilerBuilder.build
        } finally {
            // refresh the 'gen' source folder. 
            // Once this is done with the custom progress
            // monitor to mark all new files as derived
            mGenFolder.refreshLocal(IResource.DEPTH_INFINITE, mDerivedProgressMonitor);
        }
```

 

![](http://dl.iteye.com/upload/attachment/0070/7230/be08d011-ff07-3249-91fe-766b36b8d654.png)

 

[https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/)

 

https://android.googlesource.com/platform/frameworks/base.git

 

1. [aapt/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/aapt/)
2. [aidl/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/aidl/)
3. [layoutlib/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/layoutlib/)
4. [obbtool/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/obbtool/)
5. [orientationplot/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/orientationplot/)
6. [preload/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/preload/)
7. [validatekeymaps/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/validatekeymaps/)
8. [velocityplot/](https://android.googlesource.com/platform/frameworks/base.git/+/master/tools/velocityplot/)