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

查看:255
本文介绍了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 Project和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天全站免登陆