This is a new React Native project, bootstrapped using @react-native-community/cli.
Note: Make sure you have completed the Set Up Your Environment guide before proceeding.
```sh
# using npm
npm install
npx expo prebuild
First, you will need to run Metro, the JavaScript build tool for React Native.
To start the Metro dev server, run the following command from the root of your React Native project:
# Using npm
npx expo run:ios
With Metro running, open a new terminal window/pane from the root of your React Native project, and use one of the following commands to build and run your Android or iOS app:
# Using npm
npx expo run:android
For iOS, remember to install CocoaPods dependencies (this only needs to be run on first clone or after updating native deps).
The first time you create a new project, run the Ruby bundler to install CocoaPods itself:
bundle installThen, and every time you update your native dependencies, run:
bundle exec pod installFor more information, please visit CocoaPods Getting Started guide.
# Using npm
npm run ios
# OR using Yarn
yarn iosIf everything is set up correctly, you should see your new app running in the Android Emulator, iOS Simulator, or your connected device.
This is one way to run your app — you can also build it directly from Android Studio or Xcode.
Now that you have successfully run the app, let's make changes!
Open App.tsx in your text editor of choice and make some changes. When you save, your app will automatically update and reflect these changes — this is powered by Fast Refresh.
When you want to forcefully reload, for example to reset the state of your app, you can perform a full reload:
- Android: Press the R key twice or select "Reload" from the Dev Menu, accessed via Ctrl + M (Windows/Linux) or Cmd ⌘ + M (macOS).
- iOS: Press R in iOS Simulator.
You've successfully run and modified your React Native App. 🥳
- If you want to add this new React Native code to an existing application, check out the Integration guide.
- If you're curious to learn more about React Native, check out the docs.
If you're having issues getting the above steps to work, see the Troubleshooting page.
If you encounter iOS build failures with error code 65, particularly related to NitroModules SwiftEmitModule compilation or "compiling for iOS 15.1, but module 'CxxStdlib' has a minimum deployment target of iOS 16.0", this is due to an iOS deployment target mismatch.
Root Cause: NitroModules (required by @kingstinct/react-native-healthkit) requires iOS 16.0+ due to Swift C++ interoperability changes in Xcode 16.2, but the project may be targeting an older iOS version.
Update ios/Podfile to target iOS 16.0:
platform :ios, '16.0'Also add deployment target override in the post_install script:
post_install do |installer|
# ... existing post_install code ...
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Fix for NitroModules and iOS deployment target compatibility
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
# ... other build settings ...
end
end
endUpdate the iOS deployment target in your Xcode project file (ios/Slumber.xcodeproj/project.pbxproj):
Change all instances of:
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
To:
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
cd ios
rm -rf Pods
rm Podfile.lock
rm -rf build
pod install
cd ..If you see errors like "multiple definitions of symbol" related to Swift C++ interoperability, the issue has been mostly resolved but may need Xcode for final build. Try:
- Build in Xcode directly: Open
ios/Slumber.xcworkspacein Xcode and build from there - Clean derived data: In Xcode, go to Product → Clean Build Folder
- If that succeeds, command line should work:
yarn iosshould then work
If you encounter missing generated files errors:
npx react-native codegen
mkdir -p ios/build/generated/ios
cp -r build/generated/ios/* ios/build/generated/ios/npx react-native run-ios --simulator="iPhone 16 Pro"After applying these fixes:
- ✅ NitroModules will compile successfully
- ✅ HealthKit functionality is fully preserved
- ✅ App will use graceful fallbacks (mock data) if HealthKit is unavailable
- ✅ No existing functionality is lost
This fix addresses compatibility issues with:
react-native-nitro-modulesversion 0.28.1+@kingstinct/react-native-healthkitversion 9.0.11+- Xcode 16.2+ and newer Swift toolchains
- React Native New Architecture (Fabric/TurboModules)
The deployment target update is required because NitroModules uses Swift C++ interoperability features that require iOS 16.0+ as the minimum target in recent Xcode versions.
To learn more about React Native, take a look at the following resources:
- React Native Website - learn more about React Native.
- Getting Started - an overview of React Native and how setup your environment.
- Learn the Basics - a guided tour of the React Native basics.
- Blog - read the latest official React Native Blog posts.
@facebook/react-native- the Open Source; GitHub repository for React Native.