0
我需要通过使用命令行来构建R.JAVA文件。有几种IDE的使用方法,但是有什么方法或代码可以通过命令行生成R.JAVA文件吗?手动生成R.JAVA文件
我需要通过使用命令行来构建R.JAVA文件。有几种IDE的使用方法,但是有什么方法或代码可以通过命令行生成R.JAVA文件吗?手动生成R.JAVA文件
为了让应用程序源代码,以便能够将res /目录中访问 资源,一个名为
R.java
(用于 资源)类被创建。使用Android Asset Packaging Tool(AAPT)创建
R.java
文件:ANDROID_HOME/platform-tools/aapt package -v -f -m -S DEV_HOME/res -J DEV_HOME/src -M DEV_HOME/AndroidManifest.xml -I ANDROID_HOME/platforms/android-X/android.jar
的
R.java
在src /树内的目标位置是通过清单文件的包属性确定。
当选项有:
-v verbose output
-f force overwrite of existing files
-m make package directories under location specified by -J
-S directory in which to find resources. Multiple directories will be scanned
and the first match found (left to right) will take precedence.
-J specify where to output R.java resource constant definitions
-M specify full path to AndroidManifest.xml to include in zip
-I add an existing package to base include set
而且参数是:
DEV_HOME - the project directory
ANDROID_HOME - Android Software Development Kit installation location
可否请详细解释(如完整代码) –
@让BaptisteYunès不看是,这个问题的答案使用一个IDE – flakes
错了,这个问题的答案建议你手动使用蚂蚁,仔细阅读。 –