I have a project in React Native that has two different build schemes and uses cocoapods. To compile it I run:
react-native run-ios --scheme="RNProject-(SCHEME_NAME)"
The resulting apps are for example:
./build/Build/Products/Debug/iphonesimulator/RNProject-customer1.app
./build/Build/Products/Debug/iphonesimulator/RNProject-customer2.app
- Using the command it builds for one of the build schemes, but not for the other
- Xcode always builds the project for both build schemes
- Furthermore,
build/Build/Products/Debug-iphonesimulator/RNProject-customer1.app/Info.plist
exists in that path and the file contains validCFBundleIdentifier
(it matchesGeneral > Identity > Bundle Identifier
for each of the two build schemes) - Project settings seem to be correct for both schemes (after checking
ios/RNProject.xcodeproj/project.pbxproj
) - Schema-specific settings are located in
ios/Pods/Target Support Files/Pods-RNProject-customer1
andios/Pods/Target Support Files/Pods-RNProject-customer2
I tried different ways to solve it:
- Running
sudo react-native
- Restarting RN packager
- Manually editing
Info.plist
- Changing build locations
Console:
** BUILD SUCCEEDED **
Installing build/Build/Products/Debug-iphonesimulator/RNProject.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
child_process.js:509
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/RNProject.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:486:13)
at Object.execFileSync (child_process.js:506:13)
at ChildProcess.xcodeBuildProcess.on.code (node_modules/react-native/local-cli/runIOS/runIOS.js:109:36)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)