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

Build error in react native 0.77.0 #200

Open
tamacroft opened this issue Feb 7, 2025 · 3 comments
Open

Build error in react native 0.77.0 #200

tamacroft opened this issue Feb 7, 2025 · 3 comments

Comments

@tamacroft
Copy link

Now ReadableMap from com.facebook.react.bridge.ReadableMap is optional, any how to resolve this?

@tamacroft
Copy link
Author

Image

@oAnthocyane
Copy link

Hi @tamacroft,

I encountered the same issue regarding the optional ReadableMap in com.facebook.react.bridge.ReadableMap. As a temporary workaround, I modified two lines directly in the node_modules/react-native-health-connect package:

In ReactHealthRecord.kt (line 55), I changed:

val recordType = reactRecords.getMap(0).getString("recordType")

to

val recordType = reactRecords.getMap(0)!!.getString("recordType")

In HealthConnectUtils.kt (line 65), I changed:

list.add(getMap(i))

to

list.add(getMap(i)!!)

This forces the compiler to treat the ReadableMap? as non-null. I understand this isn’t an ideal long-term solution, so if someone more knowledgeable could submit a pull request to address this issue properly, that would be much appreciated.

@tamacroft
Copy link
Author

Hi @tamacroft,

I encountered the same issue regarding the optional ReadableMap in com.facebook.react.bridge.ReadableMap. As a temporary workaround, I modified two lines directly in the node_modules/react-native-health-connect package:

In ReactHealthRecord.kt (line 55), I changed:

val recordType = reactRecords.getMap(0).getString("recordType")

to

val recordType = reactRecords.getMap(0)!!.getString("recordType")

In HealthConnectUtils.kt (line 65), I changed:

list.add(getMap(i))

to

list.add(getMap(i)!!)

This forces the compiler to treat the ReadableMap? as non-null. I understand this isn’t an ideal long-term solution, so if someone more knowledgeable could submit a pull request to address this issue properly, that would be much appreciated.

thanks this work

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

No branches or pull requests

2 participants