Q:

what is generated and intermediates folders in build directory and why outputs folder is missing

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) What are generated, intermediates and tpm folders?
2) Why aren't the outputs and tmp folder shown in studio's project tree?

A:

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.
The "intermediates" folder contains individual files that are created during the build process and which are eventually combined to produce the "apk" file.
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.

