How To Build a Project

Generally speaking, building a project means compiling the source files, executing the tests and generating the module artifact. Depending on the nature of the project, the build can include other specific phases. Refer to the Module Natures page for a complete description of the build phases.

The build of a project is done by executing the Gradle build task.

It can be executed from Android Studio or IntelliJ IDEA by double-clicking on the build task in the Gradle tasks view:

../../_images/intellij-build-gradle-project.png

Gradle stores the artifacts produced by the build in the build/libs folder.

Note

If the build fails with a message related to the Artifact Checker such as:

The Artifact Checker found the following problems:

Fix the listed problems or skip the Artifact Checker by adding the following line in the build script file:

project.gradle.startParameter.excludedTaskNames.add("checkModule")