WebViewGoogle和Chrome的踩坑总结

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaoyantan/article/details/83620162

首先看一下谷歌的叙述

On Android 7.x where first api < 24, you should preinstall a regular APK of both Chrome and WebView, of the same version as each other.
On Android 7.x where first api >= 24, you should preinstall Chrome, and the WebView stub 0.0.0.1.
On Android 8.x and later, you should preinstall Chrome and the WebView stub of the same version as Chrome.

在GMS中WebViewGoogle和Chrome是比较特殊的一对App,更新的时候一不小心就可能造成CTS fail和GTS fail,影响比较大。

对于first api < 24 (一般是 android 7.0 ,7.1的机型 ),只要WebViewGoogle和Chrome的版本保持一致就行了。

对于 first api >= 24 ,有如下总结点:

  1. 国际版预置的是Chrome 和WebViewStub ,国内版没有Chrome,只预置WebViewGoogle
  2. 在android 7.1 上,WebViewStub的版本是0.0.0.1, android 8.x and later WebViewStub已经有自己的版本且要与Chrome的版本一致。

还有一点必须要注意(亲自踩过坑):

在Android 7.1上的机型,有的first api 是23,有的是25,然而我们vendor/google是共分支,所以更新的时候要注意:

  1. WebViewGoogle和Chrome都要更新且版本保持一致,以使用于first api是23的机型。
  2. WebViewStub 保持不变或者更新为一个版本为0.0.0.1的apk(现在比较难找到这样的apk),以适用于first api为25的机型。
    So,没什么必要,不要更新android 7.x and before 机型的Chrome和WebView。

查看机器的first api :adb shell getprop ro.product.first_api_level

猜你喜欢

转载自blog.csdn.net/xiaoyantan/article/details/83620162