Gradle with Android

Posted Tekkaman

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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:

  

  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

  参考:http://android.xsoftlab.net/tools/building/multidex.html

以上是关于Gradle with Android的主要内容,如果未能解决你的问题,请参考以下文章

android 编译错误 Error:(1, 0) Plugin with id 'com.android.application' not found.

Android Studio 开发安卓软件时下载的工程项目 Sync with gradle 失败

setUserVisibleHint with Fragments for android

怎样解决this version of android studio is incompatible with the gradle plugi

Android Gradle 编译错误Java finished with non-zero exit value 2

OpenCv with Android studio 1.3+ using new gradle - undefined reference