Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The root cause is in mobile-scanner; this PR only works around it from mobile-ui. It affects mobile-ui 0.9.0, the first release with the emoji picker, whose
That breaks as soon as any library adds full Guava at runtime only:
The emoji picker (#180) is the first library to do this, but another plugin or an app's own dependencies could do the same. Fixing it here protects scanner users only from the emoji picker. The proper fix is for mobile-scanner to declare the dependency it uses, e.g. |
Since
<native:emoji-picker>(#180), an app that also usesnativephp/mobile-scanner1.1.0 no longer compiles on Android. I hit this with mobile-uimain(2bfd783) on nativephp/mobile 4.7:Cause
#180 adds
androidx.emoji2:emoji2-emojipicker:1.7.0. That artifact pulls in full Guava (com.google.guava:guava:32.0.1-android) only at runtime.Guava declares
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava. AGP's consistent resolution then applies that version todebugCompileClasspathas well. CameraX'slistenablefuture:1.0becomes the empty stub, and Guava itself isn't on the compile classpath, soListenableFuturedisappears for any code that callsProcessCameraProvider.getInstance(...)../gradlew :app:dependencyInsight --configuration debugCompileClasspath --dependency com.google.guavashows:Guava's only runtime source is
androidx.emoji2:emoji2-emojipicker:1.7.0. The same app compiles on mobile-ui 0.8.0, which has no emoji picker, with the same CameraX and scanner dependencies.Fix
This PR declares Guava next to the emoji picker in
nativephp.jsonso it's on the compile classpath too. It's the same version that's already on the runtime classpath:I verified this on the Android 16 emulator, with the dependency patched into an app's vendor copy. The build succeeds and the scanner works: scanning opens rounds, and cancelling and denying the camera behave as before.
It also adds a manifest test so the dependency doesn't get dropped later.
🤖 Generated with Claude Code