Instant app release error: targeting apk difference

Instant app release error: targeting apk difference

我在 google 播放控制台中尝试发布我的免安装应用程序时遇到了这个问题:

PROBLEM

Some users of this Instant App APKs will not be eligible for any of the APKs in your installed app.

RESOLUTION

Ensure that the targeting of your Instant App APKs matches the targeting of your APKs.

我搜索了解决方案并找到了这个问题:

我已经使用 aapt 工具调试了我的 apks(即时应用程序工件是 .zip 存档,所以我已经提取它并分析了存储在那里的 apk),这是我发现的不同之处:

已安装的应用输出:

...
application-label-es-ES:’app-name’
...
application-icon-65535:'res/mipmap-xxxhdpi-v4/ic_launcher.png’
...
 uses-gl-es: '0x20000'
...

免安装应用程序没有这样的行。 安装的应用程序中还有两种语言环境,它们没有出现在即时应用程序中:es-ESid,以及一种密度:65545.

所有其他内容(包括所有权限)都是相同的。我不提供输出,因为它们太大了,但如果有必要,我可以附上它们。

问题出在行 uses-gl-es: '0x20000' 上。它说该应用程序使用 OpenGl 库。使用它的原因是在安装的应用程序中依赖 play-services-maps 库,而不是在即时应用程序中。所以,我只是在即时应用依赖项中添加了这一行:

com.google.android.gms:play-services-maps:16.0.0

一切都开始工作了。希望这会对某人有所帮助。