D8和R8 Android之间的区别 [英] Difference between D8 and R8 android

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

问题描述

随着android studio引入了两个新工具D8和R8.根据google文档,D8是dex工具,R8是progourd工具,但由于它们的解释,它们都在执行如下所示的几乎相同的操作:

As android studio introduced two new tools D8 and R8. As per google documentation D8 is a dex tool and R8 is a progourd tool but as their explanation both are doing almost same thing like below:

D8是将Java字节码转换为dex代码的dexer.

D8 is a dexer that converts java byte code to dex code.

R8是一个Java程序缩小和缩小工具,可将Java字节码转换为优化的dex代码.

R8 is a java program shrinking and minification tool that converts java byte code to optimized dex code.

似乎两个都将java字节代码从字面上转换为dex代码.那么,在转换dex代码的情况下,他们实际上在内部做什么?

It seems both converts java byte code to dex code literally. So, Whats actually they are doing internally in case of converting dex code?

推荐答案

D8 dexer和R8收缩器

D8 dexer and R8 shrinker

D8-> D8是将Java字节代码转换为dex代码的dexer.

D8->D8 is a dexer that converts java byte code to dex code.

R8-> R8是一个Java程序缩小和缩小工具,可以将Java字节代码转换为优化的dex代码.

R8->R8 is a java program shrinking and minification tool that converts java byte code to optimized dex code.

Android开发人员知道,dex编译是构建APK的关键步骤.这是将.class字节码转换为Android运行时(或Dalvik,对于旧版本的Android)的.dex字节码的过程.dex编译器通常在您日常的应用程序开发中发挥作用,但是它直接影响应用程序的构建时间,.dex文件大小和运行时性能.

Android developers know that dex compilation is a key step in building an APK. This is the process of transforming .class bytecode into .dex bytecode for the Android Runtime (or Dalvik, for older versions of Android). The dex compiler mostly works under the hood in your day-to-day app development, but it directly impacts your app's build time, .dex file size, and runtime performance.

R8项目使用chrome项目中的depot_tools来管理依赖项.安装depot_tools并将其添加到您的路径,然后继续.

The R8 project uses depot_tools from the chromium project to manage dependencies. Install depot_tools and add it to your path before proceeding.

R8项目使用Java 8语言功能,并且需要Java 8编译器和运行时系统.

The R8 project uses Java 8 language features and requires a Java 8 compiler and runtime system.

  • SDK工具修订号之后的新版本号方案.
  • 支持真正的调试版本.无需更改其中的debuggable的值Android清单.

  • New version number scheme following the SDK Tools revision number.
  • Support for true debug build. No need to change the value of debuggable in the Android Manifest.

增量构建将在使用时自动插入debuggable == true导出已签名/未签名的应用程序包"将不会.如果设置了debuggable = true,则发布版本实际上将执行调试版本.

Incremental build will automatically insert debuggable==true while using the "export signed/unsigned application package" will not. If debuggable=true is set, then release builds will actually do a debug build.

发行版中的自动Proguard支持.只需要有一个proguard.config

Automatic Proguard support in release builds. Only need to have a proguard.config

default.properties中的属性,该属性指向proguard配置文件.

property in default.properties that points to a proguard config file.

完全重写了Visual Layout Editor.这是一个很大的工作.

Completely rewritten Visual Layout Editor. This is very much a work in progress.

  • 对所有Layout类从调色板到布局进行完全拖放.
  • 将窗口小部件中的窗口小部件从一个布局视图移动到另一个,并从一个布局文件移动到另一个.

  • full drag and drop from palette to layout for all Layout classes.
  • Move widgets inside a Layout view, from one Layout view to another and from one layout file to another.

具有枚举/标志类型属性的上下文菜单.

Contextual menu with enum/flag type properties.

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

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