You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
react-native run-ios fails if .xcodeproj doesn't live next to Podfile:
error Cannot read properties of undefined (reading 'schemes').
TypeError: Cannot read properties of undefined (reading 'schemes')
at getConfiguration (/~/example/node_modules/@react-native-community/cli-platform-ios/build/commands/buildIOS/getConfiguration.js:31:43)
at Object.runIOS [as func] (/~/example/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:97:66)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command.handleAction (/~/example/node_modules/@react-native-community/cli/build/index.js:118:9)
It looks like CLI is again assuming that .xcodeproj files live next to Podfile and .xcworkspace. In 8.0, there was a significant amount of work to get rid of this assumption, but it looks like we've regressed. I did a quick investigation and it looks like run-ios is trying to find the scheme, but fails because xcodebuild -list -json returns:
In this case, it would wrongly choose boost. In a different app, this could pick another random library.
Reproducible Demo
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version 0.73 -- --core-only
yarn
cd example
pod install --project-directory=ios
# Because of an issue with finding CocoaPods, you may have to remove lines 68-70 in
# node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js
yarn ios
The text was updated successfully, but these errors were encountered:
Environment
Description
react-native run-ios
fails if.xcodeproj
doesn't live next toPodfile
:It looks like CLI is again assuming that
.xcodeproj
files live next toPodfile
and.xcworkspace
. In 8.0, there was a significant amount of work to get rid of this assumption, but it looks like we've regressed. I did a quick investigation and it looks likerun-ios
is trying to find the scheme, but fails becausexcodebuild -list -json
returns:getProjectInfo()
assumesproject
exists:cli/packages/cli-platform-ios/src/tools/getProjectInfo.ts
Lines 7 to 8 in 1749483
But it doesn't, as we can see above. Further,
getConfiguration()
also assumes thatproject.schemes[0]
is the target scheme:cli/packages/cli-platform-ios/src/commands/buildIOS/getConfiguration.ts
Line 21 in 1749483
In this case, it would wrongly choose
boost
. In a different app, this could pick another random library.Reproducible Demo
The text was updated successfully, but these errors were encountered: