Technical docs‎ > ‎New Build System‎ > ‎

Migrating to Gradle

This page is obsolete. Redirecting to https://developer.android.com/studio/intro/migrate.html






There are two types of Android projects that work in Android Studio:
  • Gradle-based projects. These are created by default.
  • IntelliJ "classic" projects. These cannot be created in Studio, but when they are created in IntelliJ, they can be opened in Studio.
In Android Studio, we are focusing all of our efforts on the Gradle-based projects, both in terms of feature development and in testing. If you are using Studio, we strongly recommend you use Gradle-based projects. If you prefer IntelliJ projects, you might want to use IntelliJ: The Android support in Studio, including the gradle support, is also all available in IntelliJ.

At this point, migration from IntelliJ classic projects to Gradle-based projects is not automatic, but it is described here:

If you happen to have created your IntelliJ project by importing an Eclipse project, you should just export your Eclipse project directly to Gradle first, as described here:

Gradle based projects offer significant features for Android development.
  • Support for binary libraries (AARs). You no longer need to copy library sources (such as ActionBarSherlock) into your own projects, you can simply declare a dependency and the library is automatically downloaded and merged into your project. This includes automatically merging in resources, manifest entries, proguard exclusion rules, custom lint rules etc at build time.
  • Support for variants and build types. This makes it trivial to for example offer different versions of your app such as a free version and a "pro" version.
  • Easy build configuration and customization. For example, you can pull version names and version codes from git tags as part of the build.
  • Gradle can be used from the IDE but also from the command line and from CI servers like Jenkins, providing the same build everywhere, every time.
There are many more; see the user guide for details.

Comments