Skip to content

J-Reed700/Slumber

Repository files navigation

This is a new React Native project, bootstrapped using @react-native-community/cli.

Getting Started

Note: Make sure you have completed the Set Up Your Environment guide before proceeding.

Step 1: Start Metro


```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 

Step 2: Build and run your app

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:

Android

# Using npm
npx expo run:android

iOS

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 install

Then, and every time you update your native dependencies, run:

bundle exec pod install

For more information, please visit CocoaPods Getting Started guide.

# Using npm
npm run ios

# OR using Yarn
yarn ios

If 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.

Step 3: Modify your app

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.

Congratulations! 🎉

You've successfully run and modified your React Native App. 🥳

Now what?

  • 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.

Troubleshooting

If you're having issues getting the above steps to work, see the Troubleshooting page.

iOS Build Issues with NitroModules and HealthKit

Problem

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.

Solution

1. Update Podfile

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
end

2. Update Xcode Project Settings

Update 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;

3. Clean and Reinstall Dependencies

cd ios
rm -rf Pods
rm Podfile.lock
rm -rf build
pod install
cd ..

Alternative: If you still encounter Swift symbol conflicts

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:

  1. Build in Xcode directly: Open ios/Slumber.xcworkspace in Xcode and build from there
  2. Clean derived data: In Xcode, go to Product → Clean Build Folder
  3. If that succeeds, command line should work: yarn ios should then work

4. Generate Required Files (if needed)

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/

5. Build the App

npx react-native run-ios --simulator="iPhone 16 Pro"

Expected Behavior

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

Technical Details

This fix addresses compatibility issues with:

  • react-native-nitro-modules version 0.28.1+
  • @kingstinct/react-native-healthkit version 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.

Learn More

To learn more about React Native, take a look at the following resources:

About

Slumber React Native App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published