Skip to content

Fix Activity Result launcher compilation - #58688

Closed
Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D121845437
Closed

Abbondanzo wants to merge 1 commit into
react:mainfrom
Abbondanzo:export-D121845437

Conversation

@Abbondanzo

Copy link
Copy Markdown
Contributor

Summary:
Different AndroidX artifacts expose ActivityResultLauncher.contract as either a Kotlin property or a Java getContract() method. A Kotlin subclass cannot override both source representations even though they have the same JVM signature.

Route the contract accessor through a package-private Java superclass so both representations resolve to the same JVM method. Use the bridge in production and test launchers, verify that the registered contract is preserved, and allowlist this required Java compatibility source.

Changelog:
[Android][Fixed] - Fix Activity Result launcher compilation across AndroidX source variants

Differential Revision: D121845437

Summary:
Different AndroidX artifacts expose `ActivityResultLauncher.contract` as either a Kotlin property or a Java `getContract()` method. A Kotlin subclass cannot override both source representations even though they have the same JVM signature.

Route the contract accessor through a package-private Java superclass so both representations resolve to the same JVM method. Use the bridge in production and test launchers, verify that the registered contract is preserved, and allowlist this required Java compatibility source.

Changelog:
[Android][Fixed] - Fix Activity Result launcher compilation across AndroidX source variants

Differential Revision: D121845437
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 25, 2026
@meta-codesync

meta-codesync Bot commented Sep 25, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D121845437.

@meta-codesync meta-codesync Bot closed this in d7ff82e Sep 26, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 26, 2026
@meta-codesync

meta-codesync Bot commented Sep 26, 2026

Copy link
Copy Markdown

This pull request has been merged in d7ff82e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant