android gradle 插件和 gradle 的区别 [英] difference between android gradle plugin and gradle

查看:31
本文介绍了android gradle 插件和 gradle 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 3.2 Canary 5
Build #AI-173.4630681, built on March 3, 2018
JRE: 1.8.0_152-release-1136-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.4-300.fc27.x86_64

我刚刚开始了一个新项目,当我同步时,我得到了这个对话框.

I have just started a new project and when I sync'd I got this dialog box.

我只是想知道 Android Gradle 项目和 Gradle 有什么区别.

I am just wondering what is the difference between the Android Gradle Project and Gradle.

How would I upgrade to Gradle to version 4.5?
What is the purpose of both of these?

在此先感谢

推荐答案

即使你为java项目和android项目编写了相同的java源代码,它们的构建和执行方式也完全不同.
Java 项目源代码编译为字节码(.class 文件)并在 JVM(Java 虚拟机)上运行.Android 项目源编译为 Dalvik 字节码(.dex 文件)并在 DVM(Dalvik 虚拟机)上运行.而且这两个虚拟机执行命令的方式也不同.

Even if you have written the same java source code for a java project and android project, the way they are built and executed completely differs from each other.
Java project sources compiles to byte codes (.class files) and runs on JVM (java virtual machine). Android project sources compiles to Dalvik byte codes (.dex files) and runs on DVM (Dalvik Virtual Machine). And both of these virtual machine have different ways of executing commands.

在构建标准 Java 应用程序所没有的应用程序时,Android 项目有许多特定于平台的步骤.(如打包为 apk、自动签名、项目风格管理、最低 API 级别)通过添加 Android Gradle 插件,这些差异可以更轻松地以更精细的方式应用.(因此,构建 Android 应用程序对每个人来说都变得更加容易).

Android projects have many platform specific steps when building application that standard Java applications does not have. (like packaging as apk, automatic signing, project flavors management, minimum API level) With the addition of Android Gradle plugin these differences can be applied more easily and in a more refined way. (So building Android apps becomes easier for everyone).

这篇关于android gradle 插件和 gradle 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆