admin管理员组文章数量:1278950
I am developing a React Native app that retrieves health data using Google Health Connect. However, I am encountering the following error:
(NOBRIDGE) ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'HealthConnect' could not be found. Verify that a module by this name is registered in the native binary.
The issue seems to be related to HealthConnect not being properly linked or initialized. When I comment out the lines using my custom hook (useHealthData), in counter.tsx the app works fine with manually entered data, and the error disappears.
//const { steps, distance } = useHealthData(date); // the app uses the custom hook (useHealthData) that does the logic of getting the data
{/*<RingProgress radius={150} strokeWidth={50} progress={steps / STEPS_GOAL} />*/}
<RingProgress radius={150} strokeWidth={50} progress={0.8} />
<ThemedView style={styles.values}>
{/*<Value label="Steps" value={steps.toString()} />
<Value label="Distance" value={`${distance.toFixed(2)} km`} />*/}
The error appears only when trying to access health data.
you can see my full app and all other files in my github repository:
What I’ve Tried:
Ensured I installed react-native-health-connect correctly. Checked if useHealthData is properly imported. Confirmed the app is running on Android, since Health Connect is not available on iOS. Restarted Metro and cleaned the build (npx react-native start --reset-cache and cd android && ./gradlew clean). Rebuilt the app (npx react-native run-android).
I do not understand where is my app failing as a am new to react native. Any help and suggestions would be appreciated.
本文标签: HealthConnect Module Not FoundTurboModuleRegistry Error in React NativeStack Overflow
版权声明:本文标题:HealthConnect Module Not Found - TurboModuleRegistry Error in React Native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741222485a2361228.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论