Skip to content

fix: use enum values for userStatus instead of string on android#13

Open
osilviotti wants to merge 3 commits into
Gautham495:mainfrom
osilviotti:fix/user-status-type-fix
Open

fix: use enum values for userStatus instead of string on android#13
osilviotti wants to merge 3 commits into
Gautham495:mainfrom
osilviotti:fix/user-status-type-fix

Conversation

@osilviotti
Copy link
Copy Markdown

@osilviotti osilviotti commented May 20, 2026

When running yarn example android I was getting the following error preventing the build from completing:

e: file:///path/react-native-play-age-range-declaration/android/src/main/java/com/margelo/nitro/playagerangedeclaration/PlayAgeRangeDeclaration.kt:56:32 Argument type mismatch: actual type is 'String?', but 'PlayAgeRangeDeclarationUserStatusValues?' was expected.

I believe it came in with #10 when the type of userStatus was changed from String to PlayAgeRangeDeclarationUserStatusValues.

I've updated the user status check to explicitly return enum values, and the app now builds and runs on my Android device.

I don't have an iOS device to test on and it looks like a similar issue exists there with statusString being typed as a String rather than AppleAgeRangeDeclarationUserStatusValues (here) but didn't want to make any changes that I couldn't test.

Note: I haven't worked with Nitro Modules before - I only committed the generated files that had diffs, happy to update the PR if I've done this wrong

@Gautham495
Copy link
Copy Markdown
Owner

The android side works - @osilviotti - Can you try to upgrade the nitro package to 35.4+ so it will generate new nitro files for iOS.

@osilviotti
Copy link
Copy Markdown
Author

Just added all the other generated files @Gautham495

@Gautham495
Copy link
Copy Markdown
Owner

@osilviotti - Thanks for the change, but there is an issue with the iOS types.

This was not present before.

@osilviotti
Copy link
Copy Markdown
Author

@Gautham495 I think that's because the types were changed in #10 without running yarn nitrogen - I haven't changed any iOS files.

I can make the changes to the Swift file if you're happy to test it

@Gautham495
Copy link
Copy Markdown
Owner

The iOS side is not building which will cause issues, I will check this out - @osilviotti

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.

2 participants