Skip to content

Compile the Android screenshot module again - #1014

Merged
ivanfenenko merged 2 commits into
mainfrom
fix/android-screenshot-module-build
Nov 10, 2026
Merged

ivanfenenko merged 2 commits into
mainfrom
fix/android-screenshot-module-build

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What was broken

android/screenshot (the Paparazzi module behind the publish-ui-snapshots skill and ./gradlew :screenshot:recordPaparazziDebug) failed :screenshot:compileDebugKotlin with 438 errors. It compiles app sources through srcDirs and symlinks, it is only in the build on a Java 21 Gradle JVM, and CI runs on JDK 17. So nothing noticed when app changes broke it.

Two causes:

  1. 360 errors: unresolved R. The module's namespace was dev.opencode.mobile.screenshot, so it generated dev.opencode.mobile.screenshot.R. Shared app sources (file-type icon tables, theme, split pane, sheet, failure chrome, …) import dev.opencode.mobile.R. The icon tables alone account for 315.
  2. 78 errors: app files the compiled sources now need but the module never included. The included sources picked up new dependencies over time:
    • UiText (theme), keyboard navigation (OpenCodeInputFocus)
    • openCodeFocusRing and openCodeSecondaryClick / openCodeSwallowSecondaryPress (buttons, inputs, top bar, gallery)
    • bottom sheet detents and follow, OpenCodeTag, OpenCodeSkeletonIllustration (OpenCodeBottomSheet)
    • SessionFailure, which SessionFailureChrome now imports from domain.message

Judging by git log, this started with the file-type icons (#772) and grew with session failures (#834), keyboard support (#928), localisation (#975), and bottom sheet stops (#996). I inferred that from the history and did not bisect.

What changed

  • screenshot/build.gradle.kts: use the app's namespace, dev.opencode.mobile, so shared sources resolve R. Add the ui/keyboard, ui/text, and domain/text source directories.
  • New symlinks, following the module's existing convention:
    • ui/components/: OpenCodeFocusRing, OpenCodePointerInput, OpenCodeBottomSheetDetents, OpenCodeBottomSheetFollow, OpenCodeTag, OpenCodeSkeletonIllustration
    • domain/message/: MessageModels, FollowUpDelivery, ToolInterruption, TimelineNotice
    • domain/agent/AgentModels, domain/json/ServerPayloadJson
  • No app production code changed, and no screenshot case was removed or stubbed. The module has no committed test cases; the snapshot tests are throwaway and gitignored.
  • Second commit, optional: Android Checks sets up JDK 21 after the unit tests and runs ./gradlew :screenshot:compileDebugKotlin. Locally the compile takes a few seconds once the app's dependencies are resolved. Drop that commit if you don't want a second JDK on the runner.

Checks

  • JAVA_HOME=<JDK 21> ./gradlew :screenshot:compileDebugKotlin: 438 errors on main before the change; BUILD SUCCESSFUL after it, with 0 errors and 0 warnings.
  • JAVA_HOME=<JDK 21> ./gradlew :screenshot:compileDebugKotlin --rerun-tasks --no-build-cache --no-configuration-cache: BUILD SUCCESSFUL.
  • JAVA_HOME=<JDK 21> ./gradlew :screenshot:assembleDebug: BUILD SUCCESSFUL.
  • JAVA_HOME=<JDK 21> ./gradlew :screenshot:recordPaparazziDebug with the skill's throwaway TextInputSnapshotEvidence test: BUILD SUCCESSFUL. It recorded a correct PNG of the text input on the JVM, with no emulator. The test and PNG were deleted afterwards (both are gitignored).
  • ./gradlew :app:assembleDebug :app:testDebugUnitTest (JDK 17): BUILD SUCCESSFUL, 3507 tests, 0 failures, 0 errors, 1 skipped.
  • Merged Type live events in the domain; move UiText and SplitPanePreferences out of the wrong layer #1012's head onto this branch locally and recompiled :screenshot: clean merge, BUILD SUCCESSFUL.
  • gitleaks git --pre-commit --staged before each commit: no leaks.
  • The workflow YAML parses. The new CI step has not run yet, because draft PRs skip Android Checks.
  • No UI change.

Risks / Follow-ups

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

ivanfenenko and others added 2 commits November 10, 2026 09:08
:screenshot compiles app sources through srcDirs and symlinks, and the
app moved on without it. 438 compile errors had two causes:

- 360 unresolved `R`: shared sources import dev.opencode.mobile.R, but
  the module's namespace generated dev.opencode.mobile.screenshot.R. Use
  the app's namespace.
- 78 from app files the included sources now depend on but the module
  never compiled: UiText, keyboard navigation, focus ring and pointer
  input, bottom sheet detents and follow, tag, skeleton illustration,
  and SessionFailure with its domain message models.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Optional. Adds a JDK 21 step to Android Checks that compiles :screenshot
so app refactors that break it fail the pull request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review November 10, 2026 08:15

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 3 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.070

@ivanfenenko
ivanfenenko merged commit c2676ec into main Nov 10, 2026
@ivanfenenko
ivanfenenko deleted the fix/android-screenshot-module-build branch November 10, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant