我在 React Native 中有一个项目,它有两种不同的构建方案并使用 cocoapods。要编译它,我运行:
react-native run-ios --scheme="RNProject-(SCHEME_NAME)"
生成的应用程序例如:
./build/Build/Products/Debug/iphonesimulator/RNProject-customer1.app
./build/Build/Products/Debug/iphonesimulator/RNProject-customer2.app
- 使用它为其中一个构建方案构建的命令,而不是为另一个构建方案
- Xcode 总是为两种构建方案构建项目
- 此外,
build/Build/Products/Debug-iphonesimulator/RNProject-customer1.app/Info.plist
存在于该路径中并且文件包含有效CFBundleIdentifier
(它与General > Identity > Bundle Identifier
两个构建方案中的每一个都匹配) - 两种方案的项目设置似乎都是正确的(检查后
ios/RNProject.xcodeproj/project.pbxproj
) - 特定于模式的设置位于
ios/Pods/Target Support Files/Pods-RNProject-customer1
和ios/Pods/Target Support Files/Pods-RNProject-customer2
我尝试了不同的方法来解决它:
- 跑步
sudo react-native
- 重启 RN 打包器
- 手动编辑
Info.plist
- 更改构建位置
安慰:
** 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)