EAK*_*EAM 17 java android proguard android-studio
在我的Android应用程序我正在使用Google R8
(现在的实验版)和Proguard 6.0.3
...根据您的经验你怎么想?主要区别是什么?随着R8
我的应用程序的尺寸更小,与过程的速度相比,Proguard
真的好多了.使用时的类数R8
比较小Proguard
.
R8与现有的Proguard规则兼容,但它忽略了一些如下:
Ignoring option: -optimizationpasses"
Ignoring option: -assumenoexternalreturnvalues"
Ignoring option: -assumenoexternalsideeffects"
Run Code Online (Sandbox Code Playgroud)
它只为错过的类而不是错误提供警告,例如:
AGPBI: {"kind":"warning","text":"Missing class: sun.net.www.protocol.http.HttpURLConnection","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: com.sun.net.httpserver.HttpHandler","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: org.dbunit.dataset.datatype.DefaultDataTypeFactory","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: com.inmobi.ads.InMobiNative$NativeAdListener","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: javax.enterprise.util.AnnotationLiteral","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: sun.net.www.protocol.http.Handler","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: com.flurry.android.ads.FlurryAdNativeListener","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: sun.net.spi.nameservice.NameServiceDescriptor","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"Missing class: java.lang.ClassValue","sources":[{}],"tool":"D8"}
Run Code Online (Sandbox Code Playgroud)
因此,总的来说,我认为这R8
比Proguard
它仍然是实验版本要好得多.
谷歌说:
R8是Proguard替代整个程序缩小和优化的替代品.
我认为这是真的.
但这些工具如何在细节中起作用?是什么让主要的彼此之间的差异以及R8如何在深层运作?
更新:
更新到Android Studio 3.3 Canary 2后,使用R8时似乎APK的大小与使用Proguard没有任何区别
ps:对不起我的英文:) :) :)
归档时间: |
|
查看次数: |
1973 次 |
最近记录: |