TL;DR
The message is recommendation, not obligation, but worth using Gradle in the project.
Gradle
Gradle is an automation tool for build, that is, of the processes involving your code for compilation, packaging, testing and distribution.
A project using Gradle must have at least one file build.gradle
with the necessary settings.
Ides as Eclipse and Intellij, the latter the basis of the Android Studio, make use of the Gradle configuration to perform some automatic settings, although it is perfectly possible to perform these settings manually, that is, without Gradle.
Gradle is usually recommended for Android development rather than manual configuration, as it greatly facilitates development and standardizes procedures for compiling and distributing the project.
Example of simple configuration
To documentation gives an example of a simple configuration for an Android project:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.1.0'
}
Build Init Plugin
For some common project types, there is a Gradle plugin that lets you generate the basic configuration: Build Init Plugin. For example, if you have Gradle installed you can run the following command line:
gradle init --type java-library
Basic configuration will be created according to type (type
) design. However, this plugin is still in the incubation process and still has no option for an Android project. In addition, the configuration is basic and probably more specific changes will be needed.
Of course, each project can have different settings and you’ll probably need to go through the documentation to get all the details.
Considerations
Build automation is something that can give a headache at first, especially the first time it is done, but it is something that is paid with time.
At this point, a few times you can rely on Ides or tools to generate a basic configuration, but I don’t recommend depending on it or always follow this path. It’s best to spend a little time understanding the basics of how Gradle works.
Your project came from the eclipse?
– Caique Oliveira
No, it came from android studio same
– Biellx
@Caiqueoliveira My project came from Eclipse. In case you know how to do you could help me ?
– Victor Henrique
@Victorhenrique vc should download the project and import it in android studio through the option: import project (Eclipse ADT, Gradle,etc.)
– Caique Oliveira