'React native wont run after ejecting from expo

I developed an app using the managed expo workflow, however it's required to use a native apis (in this case WebRTC) and therefore I ran expo eject to switch to the bare workflow. However, I am getting weird errors when I try to run the app with react-native run-ios:

info Found Xcode workspace "myproject.xcworkspace"
info Launching iPhone 12 (iOS 15.4)
info Building (using "xcodebuild -workspace myproject.xcworkspace -configuration Debug -scheme myproject -destination id=4241C8A8-2BAC-45DD-A4A6-BBFC23A6C709")
(node:5087) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening myproject.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace myproject.xcworkspace -configuration Debug -scheme myproject -destination id=4241C8A8-2BAC-45DD-A4A6-BBFC23A6C709

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

note: Using new build system
note: Planning
Analyze workspace

Create build description
Build description signature: 5e9a8a54370fc02b46865b3cdf7c6f3f
Build description path: /Users/TheCorsError/Library/Developer/Xcode/DerivedData/myproject-urtidjsdfafeadfdcoawhoyie/Build/Intermediates.noindex/XCBuildData/5e9a8a54370fc02b46865b3cdf7c6f3f-desc.xcbuild

note: Build preparation complete
note: Building targets in dependency order
PhaseScriptExecution Start\ Packager /Users/TheCorsError/Library/Developer/Xcode/DerivedData/myproject-urtidjsdfafeadfdcoawhoyie/Build/Intermediates.noindex/myproject.build/Debug-iphonesimulator/myproject.build/Script-FD10A7F022414F080027D42C.sh (in target 'myproject' from project 'myproject')
    cd /Users/TheCorsError/Documents/Code/rn-project/mobile/source-expo/ios
    /bin/sh -c /Users/TheCorsError/Library/Developer/Xcode/DerivedData/myproject-urtidjsdfafeadfdcoawhoyie/Build/Intermediates.noindex/myproject.build/Debug-iphonesimulator/myproject.build/Script-FD10A7F022414F080027D42C.sh
The file /Users/TheCorsError/Documents/Code/rn-project/mobile/source-expo/ios/Vorlage/mobile/source-expo/node_modules/react-native/scripts/launchPackager.command does not exist.
Can't start packager automatically

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'myproject' from project 'myproject')

error: no such module 'ExpoModulesCore'
import ExpoModulesCore
       ^
Command EmitSwiftModule failed with a nonzero exit code

error: emit-module command failed with exit code 1 (use -v to see invocation)

objc[5100]: Class AppleTypeCRetimerRestoreInfoHelper is implemented in both /usr/lib/libauthinstall.dylib (0x20ae69eb0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1049784f8). One of the two will be used. Which one is undefined.
objc[5100]: Class AppleTypeCRetimerFirmwareAggregateRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x20ae69f00) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x104978548). One of the two will be used. Which one is undefined.
objc[5100]: Class AppleTypeCRetimerFirmwareRequestCreator is implemented in both /usr/lib/libauthinstall.dylib (0x20ae69f50) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x104978598). One of the two will be used. Which one is undefined.
objc[5100]: Class ATCRTRestoreInfoFTABFile is implemented in both /usr/lib/libauthinstall.dylib (0x20ae69fa0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1049785e8). One of the two will be used. Which one is undefined.
objc[5100]: Class AppleTypeCRetimerFirmwareCopier is implemented in both /usr/lib/libauthinstall.dylib (0x20ae69ff0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x104978638). One of the two will be used. Which one is undefined.
objc[5100]: Class ATCRTRestoreInfoFTABSubfile is implemented in both /usr/lib/libauthinstall.dylib (0x20ae6a040) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x104978688). One of the two will be used. Which one is undefined.
2022-03-19 15:49:45.188 xcodebuild[5100:60119] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-03-19 15:49:45.188 xcodebuild[5100:60119] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
** BUILD FAILED **


The following build commands failed:
        CompileSwift normal x86_64 /Users/TheCorsError/Documents/Code/rn-project/mobile/source-expo/ios/myproject/noop-file.swift (in target 'myproject' from project 'myproject')
        CompileSwift normal x86_64 /Users/TheCorsError/Documents/Code/rn-project/mobile/source-expo/ios/Pods/Target\ Support\ Files/Pods-myproject/ExpoModulesProvider.swift (in target 'myproject' from project 'myproject')
        EmitSwiftModule normal x86_64 (in target 'myproject' from project 'myproject')
        CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'myproject' from project 'myproject')
(4 failures)

info Run CLI with --verbose flag for more details.

Note that some words may be changed due to privacy concerns. These are my configs:

// app.json
{
    "expo": {
        "name": "myproject",
        "slug": "myproject",
        "version": "1.0.0",
        "orientation": "portrait",
        "icon": "./assets/icon.png",
        "splash": {
            "image": "./assets/splash.png",
            "resizeMode": "contain",
            "backgroundColor": "#ffffff"
        },
        "updates": {
            "fallbackToCacheTimeout": 0
        },
        "assetBundlePatterns": ["**/*"],
        "ios": {
            "supportsTablet": true,
            "bundleIdentifier": "com.myproject.app"
        },
        "android": {
            "adaptiveIcon": {
                "foregroundImage": "./assets/adaptive-icon.png",
                "backgroundColor": "#FFFFFF"
            },
            "package": "com.myproject.app"
        },
        "web": {
            "favicon": "./assets/favicon.png"
        }
    }
}
 // metro.config.js
    const { getDefaultConfig } = require('expo/metro-config')
    
    module.exports = (async () => {
        const config = await getDefaultConfig(__dirname)
    
        const { transformer, resolver } = config
    
        config.transformer = {
            ...transformer,
            babelTransformerPath: require.resolve('react-native-svg-transformer')
        }
        config.resolver = {
            ...resolver,
            assetExts: resolver.assetExts.filter((ext) => ext !== 'svg'),
            sourceExts: [...resolver.sourceExts, 'svg', 'cjs', 'mjs']
        }
    
        return config
    })()

//package.json
{
  "scripts": {
    "start": "expo start --dev-client",
    "dev": "expo start && i",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@apollo/client": "^3.4.7",
    "@mdi/js": "^6.5.95",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/datetimepicker": "4.0.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-picker/picker": "2.2.1",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.5",
    "@urql/core": "^2.4.3",
    "@urql/exchange-retry": "^0.3.2",
    "axios": "^0.21.1",
    "babel-loader": "^8.2.3",
    "eas-cli": "^0.47.0",
    "expo": "^44.0.0",
    "expo-app-loading": "~1.3.0",
    "expo-cli": "^5.1.2",
    "expo-dev-client": "~0.8.4",
    "expo-font": "~10.0.4",
    "expo-google-app-auth": "~8.3.0",
    "expo-google-sign-in": "~10.1.0",
    "expo-linear-gradient": "~11.0.3",
    "expo-localization": "~12.0.0",
    "expo-secure-store": "~11.1.0",
    "expo-sharing": "~10.1.0",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "expo-updates": "~0.11.6",
    "graphql": "^15.5.1",
    "i18next": "^20.2.2",
    "iterall": "^1.3.0",
    "moment": "^2.29.1",
    "prop-types": "^15.7.2",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-i18next": "^11.8.15",
    "react-native": "0.64.3",
    "react-native-action-button": "^2.8.5",
    "react-native-animatable": "^1.3.3",
    "react-native-appearance": "~0.3.3",
    "react-native-breadcrumb": "^1.2.0",
    "react-native-breadcrumb-navigation": "^1.0.4",
    "react-native-calendars": "^1.1264.0",
    "react-native-camera": "^3.43.8",
    "react-native-chart-kit": "^6.11.0",
    "react-native-draggable": "^3.3.0",
    "react-native-dropdown-picker": "^5.3.0",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.2.0",
    "react-native-maps": "0.29.4",
    "react-native-modal": "^11.10.0",
    "react-native-modal-datetime-picker": "^9.2.3",
    "react-native-pager-view": "5.4.9",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-svg": "12.1.1",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^3.0.1",
    "react-native-touchable-scale": "^2.1.2",
    "react-native-vector-icons": "^9.0.0",
    "react-native-web": "0.17.1",
    "react-redux": "^7.2.4",
    "redux": "^4.1.0",
    "redux-logger": "^3.0.6",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "rn-placeholder": "^3.0.3",
    "rn-range-slider": "^2.0.4",
    "subscriptions-transport-ws": "^0.11.0",
    "url": "^0.11.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react-native": "~0.64.12",
    "typescript": "~4.3.5"
  },
  "private": true,
  "name": "source-expo",
  "version": "1.0.0"
}
// react-native info
System:
    OS: macOS 12.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 120.25 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    Watchman: 2022.03.14.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8193401
    Xcode: 13.3/13E113 - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.3 => 0.64.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
//expo doctor
🎉 Didn't find any issues with the project!
//Podfile

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules")

platform :ios, '12.0'

require 'json'
podfile_properties = JSON.parse(File.read('./Podfile.properties.json')) rescue {}

target 'myproject' do
  use_expo_modules!
  config = use_native_modules!

  pod 'expo-dev-launcher', path: '../node_modules/expo-dev-launcher', :configurations => :debug
  pod 'expo-dev-menu', path: '../node_modules/expo-dev-menu', :configurations => :debug
  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == 'hermes'
  )

  # Uncomment to opt-in to using Flipper
  #
  # if !ENV['CI']
  #   use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1')
  # end

  post_install do |installer|
    react_native_post_install(installer)

    # Workaround `Cycle inside FBReactNativeSpec` error for react-native 0.64
    # Reference: https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933
    installer.pods_project.targets.each do |target|
      if (target.name&.eql?('FBReactNativeSpec'))
        target.build_phases.each do |build_phase|
          if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
            target.build_phases.move(build_phase, 0)
          end
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end

end



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source