react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.31k stars 896 forks source link

Invalid `Podfile` file: undefined method `[]' for nil:NilClass. #860

Closed sibelius closed 4 years ago

sibelius commented 4 years ago

Environment

System:
    OS: macOS 10.15.1
    CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
    Memory: 62.27 MB / 16.00 GB
    Shell: 5.0.11 - /usr/local/bin/bash
  Binaries:
    Node: 12.13.0 - /var/folders/n_/30jh5m816yzg3_cftvg647j40000gn/T/yarn--1574276617063-0.927548752503313/node
    Yarn: 1.19.1 - /var/folders/n_/30jh5m816yzg3_cftvg647j40000gn/T/yarn--1574276617063-0.927548752503313/yarn
    npm: 6.13.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 22, 23, 24, 25, 26, 27, 28
      Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.2, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.3, 28.0.0, 28.0.3
      System Images: android-25 | Android TV Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-N | Android TV Intel x86 Atom, android-N | Android Wear ARM EABI v7a, android-N | Android Wear Intel x86 Atom, android-N | Intel x86 Atom, android-N | Intel x86 Atom_64, android-P | Google Play Intel x86 Atom
      Android NDK: 20.1.5948944
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.2.1/11B500 - /usr/bin/xcodebuild
  npmPackages:
    @react-native-community/cli: 3.0.4 => 3.0.4 
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.4 => 0.61.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native-create-library: 3.1.2
    react-native-git-upgrade: 0.2.7

Description

[!] Invalid `Podfile` file: undefined method `[]' for nil:NilClass.

 #  from /app/packages/app/ios/Podfile:57
 #  -------------------------------------------
 #    # react_native_firebase!
 >    use_native_modules!
 #  end
 #  -------------------------------------------

Reproducible Demo

my podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'

# plugin 'cocoapods-fix-react-native'git st
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# require_relative '../node_modules/@react-native-firebase/app/pod_config'

project 'app', { 'Alpha' => :release, 'Staging' => :release }

target 'app' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!

  # Pods for app
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  # pod 'React-RCTLinking', :podspec => '../node_modules/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec'

  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios/RNFirebase.podspec'

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

 target 'appTests' do
    inherit! :search_paths
    # Pods for testing
  end

  # react_native_firebase!
  use_native_modules!
end

target 'app-tvOS' do
  # Comment the next line if you don't want to use dynamic frameworks
  # use_frameworks!

  # Pods for app-tvOS

  target 'app-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

this is a monorepo setup

this is a list of react-native packages used

"@react-native-community/async-storage": "1.6.3",
"@react-native-community/cameraroll": "^1.3.0",
"@react-native-community/cli": "3.0.4",
    "@react-native-community/cli-platform-android": "3.0.3",
    "@react-native-community/cli-platform-ios": "3.0.0",
"react-native-camera": "3.11.1",
    "react-native-device-info": "5.3.1",
    "react-native-document-picker": "3.2.4",
"react-native-firebase": "5.5.6",
    "react-native-gesture-handler": "1.5.0",
    "react-native-image-resizer": "1.1.0",
"react-native-linear-gradient": "2.5.6",
    "react-native-localization": "2.1.6",
    "react-native-reanimated": "1.4.0",
    "react-native-screens": "2.0.0-alpha.11",
    "react-native-splash-screen": "3.2.0",
    "react-native-svg": "9.13.3",
    "react-native-tts": "3.0.0",
    "react-native-voice": "git+https://github.com/wenkesj/react-native-voice.git#62a3a0e40fece93c0d4b5c664d563207a960ef87",
    "react-native-webview": "7.5.1",
    "reanimated-bottom-sheet": "1.0.0-alpha.16",
thymikee commented 4 years ago

When did it start happening? Can you provide a repro? Running npx react-native config would be helpful as well

sibelius commented 4 years ago

we upgrade from cli v2 to cli v3

image

npx react-native config

{
  "root": "/app/packages/app",
  "reactNativePath": "/app/packages/app/node_modules/react-native",
  "dependencies": {
    "@app/core": {
      "root": "/app/packages/core",
      "name": "@app/core",
      "platforms": {
        "ios": null,
        "android": null
      },
      "assets": [
        "/app/packages/core/src/assets/fonts/Montserrat-Bold.ttf",
        "/app/packages/core/src/assets/fonts/Montserrat-Regular.ttf",
        "/app/packages/core/src/assets/fonts/Montserrat-SemiBold.ttf",
        "/app/packages/core/src/assets/fonts/OpenSans-Bold.ttf",
        "/app/packages/core/src/assets/fonts/OpenSans-Regular.ttf",
        "/app/packages/core/src/assets/fonts/OpenSans-SemiBold.ttf"
      ],
      "hooks": {},
      "params": []
    },
    "@react-native-community/async-storage": {
      "root": "/app/packages/app/node_modules/@react-native-community/async-storage",
      "name": "@react-native-community/async-storage",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/@react-native-community/async-storage/ios",
          "folder": "/app/packages/app/node_modules/@react-native-community/async-storage",
          "pbxprojPath": "/app/packages/app/node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/@react-native-community/async-storage/RNCAsyncStorage.podspec",
          "projectPath": "/app/packages/app/node_modules/@react-native-community/async-storage/ios/RNCAsyncStorage.xcodeproj",
          "projectName": "RNCAsyncStorage.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/@react-native-community/async-storage/android",
          "folder": "/app/packages/app/node_modules/@react-native-community/async-storage",
          "packageImportPath": "import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;",
          "packageInstance": "new AsyncStoragePackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "@react-native-community/cameraroll": {
      "root": "/app/packages/app/node_modules/@react-native-community/cameraroll",
      "name": "@react-native-community/cameraroll",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/@react-native-community/cameraroll/ios",
          "folder": "/app/packages/app/node_modules/@react-native-community/cameraroll",
          "pbxprojPath": "/app/packages/app/node_modules/@react-native-community/cameraroll/ios/RNCCameraRoll.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/@react-native-community/cameraroll/react-native-cameraroll.podspec",
          "projectPath": "/app/packages/app/node_modules/@react-native-community/cameraroll/ios/RNCCameraRoll.xcodeproj",
          "projectName": "RNCCameraRoll.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/@react-native-community/cameraroll/android",
          "folder": "/app/packages/app/node_modules/@react-native-community/cameraroll",
          "packageImportPath": "import com.reactnativecommunity.cameraroll.CameraRollPackage;",
          "packageInstance": "new CameraRollPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-app-auth": {
      "root": "/app/packages/app/node_modules/react-native-app-auth",
      "name": "react-native-app-auth",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-app-auth/ios",
          "folder": "/app/packages/app/node_modules/react-native-app-auth",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-app-auth/ios/RNAppAuth.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-app-auth/react-native-app-auth.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-app-auth/ios/RNAppAuth.xcodeproj",
          "projectName": "RNAppAuth.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-app-auth/android",
          "folder": "/app/packages/app/node_modules/react-native-app-auth",
          "packageImportPath": "import com.rnappauth.RNAppAuthPackage;",
          "packageInstance": "new RNAppAuthPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-camera": {
      "root": "/app/packages/app/node_modules/react-native-camera",
      "name": "react-native-camera",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-camera/ios",
          "folder": "/app/packages/app/node_modules/react-native-camera",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-camera/ios/RNCamera.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-camera/react-native-camera.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-camera/ios/RNCamera.xcodeproj",
          "projectName": "RNCamera.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-camera/android",
          "folder": "/app/packages/app/node_modules/react-native-camera",
          "packageImportPath": "import org.reactnative.camera.RNCameraPackage;",
          "packageInstance": "new RNCameraPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-device-info": {
      "root": "/app/packages/app/node_modules/react-native-device-info",
      "name": "react-native-device-info",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-device-info/ios",
          "folder": "/app/packages/app/node_modules/react-native-device-info",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-device-info/RNDeviceInfo.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj",
          "projectName": "RNDeviceInfo.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-device-info/android",
          "folder": "/app/packages/app/node_modules/react-native-device-info",
          "packageImportPath": "import com.learnium.RNDeviceInfo.RNDeviceInfo;",
          "packageInstance": "new RNDeviceInfo()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-document-picker": {
      "root": "/app/packages/app/node_modules/react-native-document-picker",
      "name": "react-native-document-picker",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-document-picker/ios",
          "folder": "/app/packages/app/node_modules/react-native-document-picker",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-document-picker/ios/RNDocumentPicker.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-document-picker/react-native-document-picker.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-document-picker/ios/RNDocumentPicker.xcodeproj",
          "projectName": "RNDocumentPicker.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-document-picker/android",
          "folder": "/app/packages/app/node_modules/react-native-document-picker",
          "packageImportPath": "import io.github.elyx0.reactnativedocumentpicker.DocumentPickerPackage;",
          "packageInstance": "new DocumentPickerPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-firebase": {
      "root": "/app/packages/app/node_modules/react-native-firebase",
      "name": "react-native-firebase",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-firebase/ios",
          "folder": "/app/packages/app/node_modules/react-native-firebase",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-firebase/ios/RNFirebase.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-firebase/ios/RNFirebase.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-firebase/ios/RNFirebase.xcodeproj",
          "projectName": "RNFirebase.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-firebase/android",
          "folder": "/app/packages/app/node_modules/react-native-firebase",
          "packageImportPath": "import io.invertase.firebase.RNFirebasePackage;",
          "packageInstance": "new RNFirebasePackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-gesture-handler": {
      "root": "/app/packages/app/node_modules/react-native-gesture-handler",
      "name": "react-native-gesture-handler",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-gesture-handler/ios",
          "folder": "/app/packages/app/node_modules/react-native-gesture-handler",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-gesture-handler/RNGestureHandler.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj",
          "projectName": "RNGestureHandler.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-gesture-handler/android",
          "folder": "/app/packages/app/node_modules/react-native-gesture-handler",
          "packageImportPath": "import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;",
          "packageInstance": "new RNGestureHandlerPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-image-resizer": {
      "root": "/app/packages/app/node_modules/react-native-image-resizer",
      "name": "react-native-image-resizer",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-image-resizer/ios",
          "folder": "/app/packages/app/node_modules/react-native-image-resizer",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-image-resizer/react-native-image-resizer.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-image-resizer/ios/RCTImageResizer.xcodeproj",
          "projectName": "RCTImageResizer.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-image-resizer/android",
          "folder": "/app/packages/app/node_modules/react-native-image-resizer",
          "packageImportPath": "import fr.bamlab.rnimageresizer.ImageResizerPackage;",
          "packageInstance": "new ImageResizerPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-linear-gradient": {
      "root": "/app/packages/app/node_modules/react-native-linear-gradient",
      "name": "react-native-linear-gradient",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-linear-gradient",
          "folder": "/app/packages/app/node_modules/react-native-linear-gradient",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-linear-gradient/BVLinearGradient.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj",
          "projectName": "BVLinearGradient.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-linear-gradient/android",
          "folder": "/app/packages/app/node_modules/react-native-linear-gradient",
          "packageImportPath": "import com.BV.LinearGradient.LinearGradientPackage;",
          "packageInstance": "new LinearGradientPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-localization": {
      "root": "/app/packages/app/node_modules/react-native-localization",
      "name": "react-native-localization",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-localization/ios",
          "folder": "/app/packages/app/node_modules/react-native-localization",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-localization/ios/ReactNativeLocalization.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-localization/ReactNativeLocalization.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-localization/ios/ReactNativeLocalization.xcodeproj",
          "projectName": "ReactNativeLocalization.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-localization/android",
          "folder": "/app/packages/app/node_modules/react-native-localization",
          "packageImportPath": "import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;",
          "packageInstance": "new ReactNativeLocalizationPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-reanimated": {
      "root": "/app/packages/app/node_modules/react-native-reanimated",
      "name": "react-native-reanimated",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-reanimated/ios",
          "folder": "/app/packages/app/node_modules/react-native-reanimated",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-reanimated/ios/RNReanimated.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-reanimated/RNReanimated.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-reanimated/ios/RNReanimated.xcodeproj",
          "projectName": "RNReanimated.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-reanimated/android",
          "folder": "/app/packages/app/node_modules/react-native-reanimated",
          "packageImportPath": "import com.swmansion.reanimated.ReanimatedPackage;",
          "packageInstance": "new ReanimatedPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-screens": {
      "root": "/app/packages/app/node_modules/react-native-screens",
      "name": "react-native-screens",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-screens/ios",
          "folder": "/app/packages/app/node_modules/react-native-screens",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-screens/ios/RNScreens.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-screens/RNScreens.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-screens/ios/RNScreens.xcodeproj",
          "projectName": "RNScreens.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-screens/android",
          "folder": "/app/packages/app/node_modules/react-native-screens",
          "packageImportPath": "import com.swmansion.rnscreens.RNScreensPackage;",
          "packageInstance": "new RNScreensPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-sentry": {
      "root": "/app/packages/app/node_modules/react-native-sentry",
      "name": "react-native-sentry",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-sentry/ios",
          "folder": "/app/packages/app/node_modules/react-native-sentry",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-sentry/ios/RNSentry.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-sentry/SentryReactNative.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-sentry/ios/RNSentry.xcodeproj",
          "projectName": "RNSentry.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [
            "libz.tbd"
          ],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-sentry/android",
          "folder": "/app/packages/app/node_modules/react-native-sentry",
          "packageImportPath": "import io.sentry.RNSentryPackage;",
          "packageInstance": "new RNSentryPackage()"
        }
      },
      "assets": [],
      "hooks": {
        "postlink": "node node_modules/@sentry/wizard/dist/bin.js -i reactNative -p ios android",
        "postunlink": "node node_modules/@sentry/wizard/dist/bin.js -i reactNative -p ios android --uninstall"
      },
      "params": []
    },
    "react-native-share": {
      "root": "/app/packages/app/node_modules/react-native-share",
      "name": "react-native-share",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-share/ios",
          "folder": "/app/packages/app/node_modules/react-native-share",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-share/ios/RNShare.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-share/RNShare.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-share/ios/RNShare.xcodeproj",
          "projectName": "RNShare.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-share/android",
          "folder": "/app/packages/app/node_modules/react-native-share",
          "packageImportPath": "import cl.json.RNSharePackage;",
          "packageInstance": "new RNSharePackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-splash-screen": {
      "root": "/app/packages/app/node_modules/react-native-splash-screen",
      "name": "react-native-splash-screen",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-splash-screen/ios",
          "folder": "/app/packages/app/node_modules/react-native-splash-screen",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-splash-screen/react-native-splash-screen.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-splash-screen/ios/SplashScreen.xcodeproj",
          "projectName": "SplashScreen.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-splash-screen/android",
          "folder": "/app/packages/app/node_modules/react-native-splash-screen",
          "packageImportPath": "import org.devio.rn.splashscreen.SplashScreenReactPackage;",
          "packageInstance": "new SplashScreenReactPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-svg": {
      "root": "/app/packages/app/node_modules/react-native-svg",
      "name": "react-native-svg",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-svg/ios",
          "folder": "/app/packages/app/node_modules/react-native-svg",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-svg/ios/RNSVG.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-svg/RNSVG.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-svg/ios/RNSVG.xcodeproj",
          "projectName": "RNSVG.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-svg/android",
          "folder": "/app/packages/app/node_modules/react-native-svg",
          "packageImportPath": "import com.horcrux.svg.SvgPackage;",
          "packageInstance": "new SvgPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-tts": {
      "root": "/app/packages/app/node_modules/react-native-tts",
      "name": "react-native-tts",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-tts/ios",
          "folder": "/app/packages/app/node_modules/react-native-tts",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-tts/ios/TextToSpeech.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-tts/TextToSpeech.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-tts/ios/TextToSpeech.xcodeproj",
          "projectName": "TextToSpeech.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-tts/android",
          "folder": "/app/packages/app/node_modules/react-native-tts",
          "packageImportPath": "import net.no_mad.tts.TextToSpeechPackage;",
          "packageInstance": "new TextToSpeechPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-voice": {
      "root": "/app/packages/app/node_modules/react-native-voice",
      "name": "react-native-voice",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-voice/ios",
          "folder": "/app/packages/app/node_modules/react-native-voice",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-voice/ios/Voice.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-voice/react-native-voice.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-voice/ios/Voice.xcodeproj",
          "projectName": "Voice.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-voice/android",
          "folder": "/app/packages/app/node_modules/react-native-voice",
          "packageImportPath": "import com.wenkesj.voice.VoicePackage;",
          "packageInstance": "new VoicePackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    },
    "react-native-webview": {
      "root": "/app/packages/app/node_modules/react-native-webview",
      "name": "react-native-webview",
      "platforms": {
        "ios": {
          "sourceDir": "/app/packages/app/node_modules/react-native-webview/ios",
          "folder": "/app/packages/app/node_modules/react-native-webview",
          "pbxprojPath": "/app/packages/app/node_modules/react-native-webview/ios/RNCWebView.xcodeproj/project.pbxproj",
          "podfile": null,
          "podspecPath": "/app/packages/app/node_modules/react-native-webview/react-native-webview.podspec",
          "projectPath": "/app/packages/app/node_modules/react-native-webview/ios/RNCWebView.xcodeproj",
          "projectName": "RNCWebView.xcodeproj",
          "libraryFolder": "Libraries",
          "sharedLibraries": [],
          "plist": [],
          "scriptPhases": []
        },
        "android": {
          "sourceDir": "/app/packages/app/node_modules/react-native-webview/android",
          "folder": "/app/packages/app/node_modules/react-native-webview",
          "packageImportPath": "import com.reactnativecommunity.webview.RNCWebViewPackage;",
          "packageInstance": "new RNCWebViewPackage()"
        }
      },
      "assets": [],
      "hooks": {},
      "params": []
    }
  },
  "commands": [
    {
      "name": "log-ios",
      "description": "starts iOS device syslog tail"
    },
    {
      "name": "run-ios",
      "description": "builds your app and starts it on iOS simulator",
      "examples": [
        {
          "desc": "Run on a different simulator, e.g. iPhone 5",
          "cmd": "react-native run-ios --simulator \"iPhone 5\""
        },
        {
          "desc": "Pass a non-standard location of iOS directory",
          "cmd": "react-native run-ios --project-path \"./app/ios\""
        },
        {
          "desc": "Run on a connected device, e.g. Max's iPhone",
          "cmd": "react-native run-ios --device \"Max's iPhone\""
        },
        {
          "desc": "Run on the AppleTV simulator",
          "cmd": "react-native run-ios --simulator \"Apple TV\"  --scheme \"helloworld-tvOS\""
        }
      ],
      "options": [
        {
          "name": "--simulator [string]",
          "description": "Explicitly set simulator to use. Optionally include iOS version betweenparenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
          "default": "iPhone X"
        },
        {
          "name": "--configuration [string]",
          "description": "Explicitly set the scheme configuration to use",
          "default": "Debug"
        },
        {
          "name": "--scheme [string]",
          "description": "Explicitly set Xcode scheme to use"
        },
        {
          "name": "--project-path [string]",
          "description": "Path relative to project root where the Xcode project (.xcodeproj) lives.",
          "default": "ios"
        },
        {
          "name": "--device [string]",
          "description": "Explicitly set device to use by name.  The value is not required if you have a single device connected."
        },
        {
          "name": "--udid [string]",
          "description": "Explicitly set device to use by udid"
        },
        {
          "name": "--no-packager",
          "description": "Do not launch packager while building"
        },
        {
          "name": "--verbose",
          "description": "Do not use xcpretty even if installed"
        },
        {
          "name": "--port [number]",
          "default": 8081
        },
        {
          "name": "--terminal [string]",
          "description": "Launches the Metro Bundler in a new window using the specified terminal path."
        }
      ]
    },
    {
      "name": "log-android",
      "description": "starts logkitty"
    },
    {
      "name": "run-android",
      "description": "builds your app and starts it on a connected Android emulator or device",
      "options": [
        {
          "name": "--root [string]",
          "description": "Override the root directory for the android build (which contains the android directory)",
          "default": ""
        },
        {
          "name": "--variant [string]",
          "description": "Specify your app's build variant",
          "default": "debug"
        },
        {
          "name": "--appFolder [string]",
          "description": "Specify a different application folder name for the android source. If not, we assume is \"app\"",
          "default": "app"
        },
        {
          "name": "--appId [string]",
          "description": "Specify an applicationId to launch after build.",
          "default": ""
        },
        {
          "name": "--appIdSuffix [string]",
          "description": "Specify an applicationIdSuffix to launch after build.",
          "default": ""
        },
        {
          "name": "--main-activity [string]",
          "description": "Name of the activity to start",
          "default": "MainActivity"
        },
        {
          "name": "--deviceId [string]",
          "description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running \"adb devices\" on the command line)."
        },
        {
          "name": "--no-packager",
          "description": "Do not launch packager while building"
        },
        {
          "name": "--port [number]",
          "default": 8081
        },
        {
          "name": "--terminal [string]",
          "description": "Launches the Metro Bundler in a new window using the specified terminal path.",
          "default": "Apple_Terminal"
        },
        {
          "name": "--tasks [list]",
          "description": "Run custom Gradle tasks. By default it's \"installDebug\""
        },
        {
          "name": "--no-jetifier",
          "description": "Do not run \"jetifier\" – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet. See more at: https://www.npmjs.com/package/jetifier.",
          "default": false
        }
      ]
    }
  ],
  "assets": [],
  "platforms": {
    "ios": {},
    "android": {}
  },
  "haste": {
    "providesModuleNodeModules": [
      "react-native"
    ],
    "platforms": [
      "ios",
      "android"
    ]
  },
  "project": {
    "ios": {
      "sourceDir": "/app/packages/app/ios",
      "folder": "/app/packages/app",
      "pbxprojPath": "/app/packages/app/ios/app.xcodeproj/project.pbxproj",
      "podfile": "/app/packages/app/ios/Podfile",
      "podspecPath": null,
      "projectPath": "/app/packages/app/ios/app.xcodeproj",
      "projectName": "app.xcodeproj",
      "libraryFolder": "Libraries",
      "sharedLibraries": [],
      "plist": [],
      "scriptPhases": []
    },
    "android": {
      "sourceDir": "/app/packages/app/android/app",
      "isFlat": false,
      "folder": "/app/packages/app",
      "stringsPath": "/app/packages/app/android/app/src/main/res/values/strings.xml",
      "manifestPath": "/app/packages/app/android/app/src/main/AndroidManifest.xml",
      "buildGradlePath": "/app/packages/app/android/app/build.gradle",
      "settingsGradlePath": "/app/packages/app/android/settings.gradle",
      "assetsPath": "/app/packages/app/android/app/src/main/assets",
      "mainFilePath": "/app/packages/app/android/app/src/main/java/app/myapp/app/MainApplication.java",
      "packageName": "app.myapp.app"
    }
  }
}
sibelius commented 4 years ago

same error on android

FAILURE: Build failed with an exception.

* Where:
Script '/app/packages/app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 206

* What went wrong:
A problem occurred evaluating script.
> React Native CLI failed to determine Android project configuration. This is likely due to misconfiguration. Config output:
  [root:/app/packages/app/android, reactNativePath:/app/packages/app/node_modules/react-native, dependencies:[:], commands:[], assets:[], platforms:[:], haste:[providesModuleNodeModules:[], platforms:[]], project:[:]]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 28s

    at checkExecSyncError (child_process.js:621:11)
    at execFileSync (child_process.js:639:15)
    at runOnAllDevices (/app/packages/app/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
    at buildAndRun (/app/packages/app/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
    at /app/packages/app/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.handleAction (/app/packages/app/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:7)
sibelius commented 4 years ago

it is breaking here

project_root = Pathname.new(config["project"]["ios"]["sourceDir"])

https://github.com/react-native-community/cli/blob/master/packages/platform-ios/native_modules.rb#L29

I think this pull request caused the problem: https://github.com/react-native-community/cli/pull/767

npx --quiet react-native config

returns

{
  "root": "/app/packages/app/ios",
  "reactNativePath": "/app/packages/app/node_modules/react-native",
  "dependencies": {},
  "commands": [],
  "assets": [],
  "platforms": {},
  "haste": {
    "providesModuleNodeModules": [],
    "platforms": []
  },
  "project": {}
}
sibelius commented 4 years ago

I think the problem is that npx --quiet react-native config returns different data when we run it inside app/ios and app

so, my guess is that react-native config is causing this trouble

sibelius commented 4 years ago

fixed removing

@react-native-community/cli @react-native-community/cli-platform-android @react-native-community/cli-platform-ios

instead I've used the one that react-native 61 depends on

cjam commented 4 years ago

I think the problem is that npx --quiet react-native config returns different data when we run it inside app/ios and app

so, my guess is that react-native config is causing this trouble

Found the same thing on a project I'm working on. I can't seem to fix it as I am currently using the @react-native-community/cli that comes with the react-native version I'm using.

I have a monorepo setup as well:

root
  packages
     mobile
         ios
         android
     web
     shared

if I run npx --quiet react-native config from root or packages the output looks fine, but if I run it from anywhere within mobile I get:

{
  "root": "/projects/MyProject/packages/mobile",
  "reactNativePath": "/projects/MyProject/node_modules/react-native",
  "dependencies": {},
  "commands": [],
  "assets": [],
  "platforms": {},
  "haste": {
    "providesModuleNodeModules": [],
    "platforms": []
  },
  "project": {}
}

Which seems to by why I can't run pod install as it's running the npx --quiet react-native config. Can this be overridden with a config file? Would love to get my project building again.

sibelius commented 4 years ago

@cjam check here https://github.com/react-native-community/cli/pull/875

cjam commented 4 years ago

@cjam check here #875

Hm. so that's related to the android side of things. It looks like it might be a bug in the react-native config command as it just isn't returning the right information when it's inside the mobile or ios folders. I made the following modification in my node_modules/@react-native-community/cli-platform-ios/native_modules.rb:

 Dir.chdir('../../'){
    IO.popen("npx --quiet react-native config") do |data|
      while line = data.gets
        json << line
      end
    end
 }

Then ran:

cd ios
pod install

and everything worked. It's a hack of course, but it seems that for some reason the cli can't determine the locations for the native projects when run inside of the mobile or ios folder.

sibelius commented 4 years ago

you can use patch-package until a fix lands

thymikee commented 4 years ago

@cjam @sibelius this should not be necessary anymore, since in v3.1 we migrated off of npx there. Please update the @react-native-community/cli to the latest version.

mikedizon commented 4 years ago

@thymikee I'm running 3.2.0 and I still get the same error when running pod install

thymikee commented 4 years ago

@mikedizon can you post a repro somewhere?

mikedizon commented 4 years ago

I'm using a monorepo. My directory structure is as follows:

projectRoot
node_modules/
 --@react-native-community/
     --cli
packages/
--mobile
    -- ios    

running pod install from the ios directory returns the error above. Wrapping


IO.popen(["node", cli_bin, "config"]) do |data|
   while line = data.gets
       json << line
    end
end`
inside of Dir.chdir('../../'){} 

beginning around line 25 fixes the issue.

thymikee commented 4 years ago

Do you use "nohoist" in yarn workspace? This might be a problem. Try removing "react-native" from "nohoist" if that's the case.

mikedizon commented 4 years ago

I don't use nohoist

mikedizon commented 4 years ago

@thymikee two things I noticed:

react-native config doesn't see any of the dependencies that are listed in my mobile directory. I had to move them from mobile/packages.json to the root packages.json for pod install to work.

I still had to modify native_modules.rb to run node react-native config up two levels.

grabbou commented 4 years ago

The original issue is fixed now that we don't run via npx, but directly with node.

On a side note, @thymikee AFAIK new architecture is totally independent of nohoist and should work "just fine".

@mikedizon, can you revert all the changes and try running yarn react-native config from packages/mobile/ios and tell us what's the output? Ideally, compare it with running the same command from packages/mobile.

I don't think there should be any difference, I haven't noticed one locally.

react-native config doesn't see any of the dependencies that are listed in my mobile directory. I had to move them from mobile/packages.json to the root packages.json for pod install to work.

Once you move them to the root package.json, you have to run react-native config up two levels, because if you run it up one level (inside packages/mobile), it will read package.json from that folder and ignore the root one (we always read the closest package.json from CWD.

Let's get things to the "base" and try to go from there.

mikedizon commented 4 years ago

@grabbou I get this error when calling react-native config from the mobile directory.

Command `config` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.

If I call the cli directly (node /path/to/project/directory/node_modules/@react-native-community/cli/build/bin.js), I get this output

{
  "root": "/path/to/project/directory/packages/mobile",
  "reactNativePath": "/path/to/project/directory/node_modules/react-native",
  "dependencies": {},
  "commands": [],
  "assets": [],
  "platforms": {},
  "haste": {
    "providesModuleNodeModules": [],
    "platforms": []
  },
  "project": {}
}

When I print outline in native_modules.rb, I see the above. The project field is empty.

I can run react-native commands from the project root just fine though.

thymikee commented 4 years ago

@mikedizon you have global react-native or react-native-cli or both installed. You need to remove them from npm and yarn and never install again.

mikedizon commented 4 years ago

@thymikee thanks, i removed react-native-cli from my global packages.

running react-native commands now returns command not found, so I ran npx react-native config from the mobile directory. The only package returned was react-native-vector-icons.

{
  "root": "/path/to/project/directory/packages/mobile",
  "reactNativePath": "/path/to/project/directory/node_modules/react-native",
  "dependencies": {
    "react-native-vector-icons": {
      "root": "/path/to/project/directory/node_modules/react-native-vector-icons",
      "name": "react-native-vector-icons",
      "platforms": {},
      "assets": [
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Feather.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
        "/path/to/project/directory/node_modules/react-native-vector-icons/Fonts/Zocial.ttf"
      ],
      "hooks": {},
      "params": []
    }
  },
  "commands": [],
  "assets": [],
  "platforms": {},
  "haste": {
    "providesModuleNodeModules": [],
    "platforms": []
  },
  "project": {}
}

Running yarn workspace mobile react-native config returns

{
  "root": "/path/to/project/directory/packages/mobile",
  "reactNativePath": "/path/to/project/directory/node_modules/react-native",
  "dependencies": {},
  "commands": [],
  "assets": [],
  "platforms": {},
  "haste": {
    "providesModuleNodeModules": [],
    "platforms": []
  },
  "project": {}
}

the contents of my react-native.config are


module.exports = {
  project: {
    ios: {},
    android: {},
  },
  assets: ['fonts'],
};
thymikee commented 4 years ago

Do you have a package.json in packages/mobile? Where are package.jsons and what native packages are inside? With a reproduction we could avoid these questions, just saying.

ahmaddehnavi commented 4 years ago

I had upgraded from 61.5 to 63.1 and my problem solved when removing path param from use_react_native! in podfile something like this: config = use_native_modules! use_react_native!

Daniel-Griffiths commented 4 years ago

Thanks @ahmaddehnavi that worked for me 😄

sulagarde commented 3 years ago

Hi! I just upgrading RN from 0.60.6 to 0.61.5 and I get the same error code (cli version => 3.2.1, cli-platform-ios => 3.2.1, cli-platform-android => 3.1.4 ).

I use yarn workspace this way:

When I run npx react-natif config from root folder (with no dependencies) the result is something like this => { "root": "/path/to/project/directory/packages/mobile", "reactNativePath": "/path/to/project/directory/node_modules/react-native", "dependencies": {}, "commands": [], "assets": [], "platforms": {}, "haste": { "providesModuleNodeModules": [], "platforms": [] }, "project": {} }

If I run in the command in src/appli/common, all dependencies are listed.

Is there something I am doing wrong?

octopicorn commented 3 years ago

@sulagarde I think if you are using workspaces, and your project is nested, you can just pass in a custom relative path to the use_react_native! method. My /node_modules/react-native is at the root directory, but my app's Podfile is down under /packages/myproject/ios so I use this in my Podfile:

  config = use_native_modules!

  use_react_native!(:path => "../../../node_modules/react-native")

all i did was pass in a custom path, and added some extra ../ as needed to make it correct

ghost commented 3 years ago

我也遇到这个问题了, 花了好多时间,

我发现,我的问题 是因为 app.json 里 的expo下的name 出现了中文, 我把我原来的中文改成英文字母, 就可以了

// app.json
  "expo": {
    "name": "这里不能用中文, the name must be ascll [a-zA-Z0-9_-] ",  
   ... ...
chetstone commented 2 years ago

I had a dummy package.json in my iOS folder. Removing it fixed this problem. Yay! I had put it in there to work around a problem building iOS back in RN32

ZainabShakeel commented 2 years ago

few files in iOS folder was deleted so beacuse of this i was facing this issues restore those files fix my problem

LoserAntbear commented 2 years ago

Same thing happened for me when I tried to list dependencies as peer-ones. So I had to move them back to regular "dependencies".

But I'm developing an internal package for RN projects, I still need these dependencies to be listed as peer-ones. Any advice on that, please?

gabrieldonadel commented 9 months ago

If you're encountering this just delete node_modules and install again, in my case "project": {} was empty

nithinyell commented 8 months ago

Some times you may also need to check the Command line tool was set correctly in xcode

Screenshot 2023-12-14 at 3 15 40 PM
LorandP commented 4 months ago

@nithinyell Thank you! I had the same issue and found it with your help

longmao commented 3 months ago

Some time you may also need to check the Command like tool was set correctly in xcode Screenshot 2023-12-14 at 3 15 40 PM

so cool!