Gradle with Android

博观而约取,厚积而薄发。这篇文章主要讲述Gradle with Android相关的知识,希望能为你提供帮助。
【Gradle with Android】
The android Studio build system is based on Gradle, and the Android plugin for Gradle adds several features that are specific to building Android apps.

1、Update the Android Plugin for Gradle
You can specify the  Android plugin for Gradle  version in either the  File  >   Project Structure  >   Project  menu in Android Studio, or the top-levelbuild.gradle  file. The plugin version applies to all modules built in that Android Studio project. The following example sets the Android plugin for Gradle to version 2.2.3 from the  build.gradle  file:

Gradle with Android

文章图片

If the specified plugin version has not been downloaded, Gradle downloads it the next time you build your project or click  Tools  >   Android  >   Sync Project with Gradle Files  from the Android Studio menu bar.
 
2、Set the Application ID
Every Android app has a unique application ID that looks like a java package name, such ascom.example.myapp. This ID uniquely identifies your app on the device and in Google Play Store. If you want to upload a new version of your app, the application ID (and the  certificate you sign it with) must be the same as the original APK—if you change the application ID, Google Play Store treats the APK as a completely different app. So once you publish your app,  you should never change the application ID.
参考:https://developer.android.com/studio/build/application-id.html#change_the_application_id_for_testing
 
3、Build System
【Gradle with Android】参考:http://android.xsoftlab.net/tools/building/multidex.html

    推荐阅读