Skip to content

fix(android): keep Firebase registrars from R8 - #145

Merged
ItsChaceD merged 1 commit into
nextfrom
fix/RMET-5542/android-r8-firebase-rule
Oct 23, 2026
Merged

ItsChaceD merged 1 commit into
nextfrom
fix/RMET-5542/android-r8-firebase-rule

Conversation

@ItsChaceD

Copy link
Copy Markdown
Contributor

Description

Adds firebase-components 18.0.1's keep rule to the plugin's proguard-rules.pro, and wires the file through consumerProguardFiles and files so it reaches apps.

ML Kit barcode scanning 17.3.0 brings firebase-components 16.1.0, whose own rule keeps ComponentRegistrar classes but not their constructors. AGP 9 no longer keeps those, so with R8 on ML Kit's components fail to register and decoding throws.

Tested on Capacitor 9.0.0-alpha.8 with R8 on, in an app where this is the only ML Kit or Firebase user. ML Kit decodes a QR code as with R8 off. With next, three registrars fail to load and decoding throws a NullPointerException.

Logs

With next:

W ComponentDiscovery: Could not instantiate com.google.mlkit.common.internal.CommonComponentRegistrar
W ComponentDiscovery: Could not instantiate com.google.mlkit.vision.barcode.internal.BarcodeRegistrar
W ComponentDiscovery: Could not instantiate com.google.mlkit.vision.common.internal.VisionCommonRegistrar

With this branch:

ML Kit decode of a generated QR code -> "RMET-QR-1"

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

https://outsystemsrd.atlassian.net/browse/RMET-5542

Platforms Affected

  • Android
  • iOS
  • Web

Notes

The rule does nothing once firebase-components 18.0.1 or later is resolved.

@ItsChaceD
ItsChaceD merged commit 86f0304 into next Oct 23, 2026
9 checks passed
@ItsChaceD
ItsChaceD deleted the fix/RMET-5542/android-r8-firebase-rule branch October 23, 2026 14:39
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.

3 participants