android gradle 插件和 gradle 的区别

difference between android gradle plugin and gradle(android gradle 插件和 gradle 的区别)
本文介绍了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 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)