envoyproxy / envoyproxy/envoy-mobile

android: mobile-install fails to install apk

Open
#853 1 comment 0 reactions 0 assignees View on GitHub
ci help wanted no stalebot
Dominant language
Java
Stars
566
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Since 05/13/2020 we have had failures when using mobile-install in macOS like [this run](https://github.com/lyft/envoy-mobile/runs/676597735).

After some digging in https://github.com/lyft/envoy-mobile/pull/850 by modifying https://github.com/bazelbuild/bazel/blob/master/tools/android/incremental_install.py I figured out that:
1. CI was trying to install the apk to the emulator using Incremental Install https://github.com/aosp-mirror/platform_system_core/blob/04aa5bedccb2391b124992785d2cb9533666b8e3/adb/client/adb_install.cpp#L345
2. But it was failing as shown in this [ci run](https://github.com/lyft/envoy-mobile/runs/679036585#step:6:129).
- Why it fails is still not clear to me. But it seems to be some incompatibility with tooling. Note that platform tools [30.0.0 added incremental install support](https://developer.android.com/studio/releases/platform-tools).
- Github actions updated to 30.0.0 [two weeks ago](https://github.com/actions/virtual-environments/pull/801/files), and to 30.0.1 in the [time frame](https://github.com/actions/virtual-environments/pull/867/files) that this breakage started appearing for us. Although I can't seem to find the changelog for 30.0.0->30.0.1.
3. `--no-incremental` is an `adb install` arg that can be used to force adb to not use incremental installs. And in this commit https://github.com/lyft/envoy-mobile/pull/850/commits/9151d4bd736f02f9a21b54e1fac6cdadd98af0a9 shows that when used makes CI happy. However, bazel has no facility to pass args to specific commands. `--adb_arg` passes indiscriminately to all adb commands, causing other failures.
4. There are other ways to turn off incremental install as shown in this function:
https://github.com/aosp-mirror/platform_system_core/blob/04aa5bedccb2391b124992785d2cb9533666b8e3/adb/client/adb_install.cpp#L361
However, none of them seemed to work on CI.

Therefore in absence of a) understanding why incremental install stopped working, and b) a method to turn it off with `mobile-install`, I have circumvented `mobile install` and manually built, installed, and started the apk in the emulator.

This issue tracks solving the unknowns listed above, and being able to go back to using `mobile-install`.

** note: the experimentation to draw these conclusions was done in https://github.com/lyft/envoy-mobile/pull/850

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.