[英]Is there a way to refer to the CFBundleIdentifier elsewhere in the Info.plist file?
[英]Detox: field CFBundleIdentifier not found inside Info.plist
我有一个 ReactNative 0.63.2
项目。 它在模拟器上运行,它在物理设备上运行。 现在决定开始使用 Detox。
运行示例测试时,我遇到了这个错误:
Error: field CFBundleIdentifier not found inside Info.plist of app binary at /Users/jesus/Documents/projects/appname/ios/build/Build/Products/Debug-iphonesimulator/Appname.app
在我的Info.plist
:
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
我的.detoxrc.json
:
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"ios": {
"type": "ios.simulator",
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Appname.app",
"build": "xcodebuild -project ios/Appname.xcodeproj -scheme Appname -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11"
}
},
"android": {
"type": "android.emulator",
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"device": {
"avdName": "Pixel_API_28_AOSP"
}
}
}
}
我检查了 Xcode > General 中是否设置了 Bundle Identifier。 在 Build Settings > Packaging 下还有一个字段,其中app.appname
设置正确。
这与排毒无关。
检查 your.app 包中的 Info.plist(不是源代码中的 Info.plist)。 最有可能的是,您的捆绑包已损坏。 iOS 要求每个应用程序都有一个有效的捆绑标识符。 在 Xcode 构建设置中可能未正确定义PRODUCT_BUNDLE_IDENTIFIER
。
我有同样的问题。
我在构建时遇到了问题,并通过复制粘贴在运行 react-native run-ios 时反应本机使用的命令来解决它们,其中有-destination id="{MyprojectID}"
在这样做时我删除了 -derivedDataPath iOS/build,我通过添加解决了它这再次与 -sdk iphonesimulator 一起,我的构建命令如下所示:
xcodebuild -workspace iOS/{AppName}.xcworkspace -configuration Debug -scheme {AppName} -sdk iphonesimulator -derivedDataPath ios/build -destination id={MyprojectID}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.