如何产生R.java [英] How to generate R.java
问题描述
我下载了一些源$ C $ CS由谷歌来源$ C $ CS。
I downloaded few source codes from Google source codes.
我执行他们的Eclipse,但 R.java
文件不被创建,所以我得到了很多的错误说研究
无法得到解决。没有的main.xml
的布局了。其他一些XML文件在那里。我怎样才能执行这些程序?
I executed them on Eclipse but R.java
file is not created and therefore I got many errors saying that R
cannot be resolved. There is no main.xml
in layout too. Some other XML files are there. How can I execute these programs?
推荐答案
只要你有一个有效的Android项目,你可以使用 AAPT包
生成R.从Java的资源。下面是用法示例(都应该在一行中):
As long as you have a valid Android project, you can use aapt package
to generate the R.java from resources. Here's example usage (all should be in one line):
aapt package --non-constant-id -f -m -M <abs_path_to_AndroidManifest.xml>
-S <abs_path_to_res_dir> -I <abs_path_to_platforms_android.jar>
-J <abs_path_to_dir_that_should_contain_gen_R_java)
--generate-dependencies
以上可以使用ANT使用AAPT目标或简单地用一个exec目标进行脚本化。
The above can be made scriptable using ANT by using the aapt target or by simply using an exec target.
这篇关于如何产生R.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!