Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check permission for null values to fix Android build issue in RN 0.77.0-rc.7 #922

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

mstrokin
Copy link
Contributor

Summary

Fixes Android build on RN 0.77.0-rc.7

Fixes #921

Test Plan

Update RN to 0.77.0-rc.7 and try to build the project.

  • [ X] I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I added a sample use of the API in the example project (example/App.tsx)

@mstrokin mstrokin requested a review from zoontek as a code owner January 21, 2025 13:23
Copy link

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

root cause - nullability of ReadableArray.getString() changed upstream, first shipped in react-native 0.77, reference facebook/react-native@145c72f#diff-cab6c32d3e05344091c804ea93e8a220dabdd75ec2a258aaf4bde7751c13f844R31

If a simpler patch using the conditional-null operator ?. was used, I think this would work on 0.77 but would fail on 0.76 because kotlin would tell you it could never be null there based on previous typing

using .isNullOrBlank() works around that so I think this should be forwards and backwards compatible

@zoontek
Copy link
Owner

zoontek commented Jan 21, 2025

LGTM, thanks @mstrokin! (and @mikehardy for the explanation)

@zoontek zoontek merged commit 1a93a67 into zoontek:master Jan 21, 2025
@zoontek
Copy link
Owner

zoontek commented Jan 21, 2025

Available in 5.2.4

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.

Android build errors with RN v0.77.0-rc.7
3 participants