在构建目录中生成了什么和中间文件夹以及为什么缺少输出文件夹 [英] what is generated and intermediates folders in build directory and why outputs folder is missing

查看:44
本文介绍了在构建目录中生成了什么和中间文件夹以及为什么缺少输出文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Android Studio 和 Gradle 构建应用程序.构建完成后,build 文件夹包含以下文件夹:

I'm building application with Android Studio and Gradle. When the build is finished the build folder contains the following folders:

- assets
- CordovaLib
  - build
  - src
  - build.gradle
- gradle
- src
  - com.my.package
    - CordovaApp
- build.gradle
- build
  - generated
  - intermediates
  - outputs        //not displayed in android studio's project tree
  - tmp            //not displayed in android studio's project tree

1) 什么是生成文件夹、中间文件夹和 tpm 文件夹?
2) 为什么工作室的项目树中没有显示输出和 tmp 文件夹?

1) What are generated, intermediates and tpm folders?
2) Why aren't the outputs and tmp folder shown in studio's project tree?

推荐答案

generated"文件夹包含 Android Studio 为模块生成的 java 代码.这里的主要文件是R.java",它为res"目录中的每个项目分配符号名称,以便它们可以在 java 源代码中引用.

The "generated" folder contains java code generated by Android Studio for the module. The primary file here is "R.java" which assigns symbolic names to each of the items in the "res" directory so they can be referenced in java source code.

intermediates"文件夹包含在构建过​​程中创建的单个文件,这些文件最终组合成apk"文件.

The "intermediates" folder contains individual files that are created during the build process and which are eventually combined to produce the "apk" file.

缺少输出文件夹,因为模块.iml"文件使用以下语句明确排除了它:

The output folder is missing because the module ".iml" file explicitly excludes it with the following statement:

<excludeFolder url="file://$MODULE_DIR$/build/outputs"/>

删除该行,输出"目录将出现在构建下.

Remove that line and the "output" directory will appear under build.

这篇关于在构建目录中生成了什么和中间文件夹以及为什么缺少输出文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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