Android CI fails when SDK or Robolectric downloads arrive corrupt

Aberta
#119 2 comentários 0 reações 1 responsável Ver no GitHub

@TheoGoulart333 já está trabalhando nisso.

Desde 7/11/2026.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
68/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
android, github-actions
Domínio
ci-cd, mobile

Direção de pesquisa

Start by reading .github/workflows/e2e.yml, .github/workflows/release-builds.yml, and the native-android workflow job to find where the emulator and Robolectric dependencies are installed. Check the Android emulator runner README for its AVD cache and snapshot setup. Done means cold caches work, warm runs skip system image and Robolectric jar downloads, and the existing shards pass unchanged.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug

Android CI jobs sometimes fail before any test runs because a download from Google or Maven Central arrives corrupt. Rerunning the job passes, but the E2E workflow has about 15 Android shards per push, so a push hits this fairly often.

What happens

reactivecircus/android-emulator-runner installs the emulator and the system image with sdkmanager on every job. Now and then the archive is corrupt:

Warning: An error occurred while preparing SDK package Intel x86_64 Atom System Image: Error reading Zip content from a SeekableByteChannel.
...
error: could not connect to TCP port 5554: Connection refused

The emulator never starts, and the job fails in "Build, install, and run E2E tests" (or "Run the release configuration" in release-builds.yml) after about a minute.

native-android has the same problem with Robolectric, which downloads its android-all jar from Maven Central at test time. When that fails, every Robolectric test fails with AssertionError at MavenArtifactFetcher.java caused by an IOException.

How often

Out of about 395 Android jobs between Oct 9 and Nov 4, 2026:

Date Branch Job Cause
Oct 27 claude/pythonnative-architecture-analysis-5b85ba e2e-android (hooks-b) Android Emulator archive corrupt ("Error on ZipFile unknown archive")
Nov 3 feat/production-platform e2e-android (misc) Android Emulator archive corrupt
Nov 3 feat/production-platform native-android Robolectric jar download failed
Nov 4 feat/production-platform e2e-android (capabilities) System image archive corrupt

In the same period, the emulator also went offline mid-run twice (main on Nov 2, and Oct 23). That's the instability the sharding in e2e.yml already works around, so it's out of scope here.

Suggested fix

  • Cache the AVD between runs, as the runner's README describes: an actions/cache step for ~/.android/avd/* and ~/.android/adb*, keyed on the API level and arch, plus a step that creates the snapshot when the cache misses. Cached runs then skip the system image download. Apply it to both e2e.yml and release-builds.yml.
  • Cache ~/.m2/repository/org/robolectric in the native-android job, so Robolectric reads its jar from the cache instead of downloading it.
  • Optionally, retry the emulator step once when its log shows an SDK download error, for whatever the cache doesn't cover.

Done means a cold cache still works, a warm cache downloads no system image or Robolectric jar, and the existing shards pass unchanged.

Linguagem predominante
Python
Estrelas
131
Forks
22
Merge médio
3d 2h
PRs com merge (30d)
5

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de pythonnative/pythonnative

Todas as issues de pythonnative/pythonnative

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.