执行npx expo run:ios时遭遇Info.plist读取错误求助
解决
npx expo run:ios执行时的Info.plist读取错误 执行
npx expo run:ios时出现错误:
无法从文件读取属性列表:/Users/jayengineer/Workspace/react_projects/Breached/ios/Breached/Info.plist:操作无法完成。(XCBUtil.PropertyListConversionError error 2.)(在项目'Breached'的目标'Breached'中)
问题根源
Info.plist文件存在XML语法错误,具体是CFBundleShortVersionString对应的<string>标签闭合错误——原代码中写成了<string>1.0.4/string>,缺少了闭合标签的左尖括号,正确格式应为</string>。
修复后的完整Info.plist代码
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleDisplayName</key> <string>Breached</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <key>CFBundleShortVersionString</key> <string>1.0.4</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLSchemes</key> <array> <string>com.jay754.Breached</string> </array> </dict> </array> <key>CFBundleVersion</key> <string>1</string> <key>LSApplicationCategoryType</key> <string></string> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <false/> <key>NSAllowsLocalNetworking</key> <true/> </dict> <key>UILaunchStoryboardName</key> <string>SplashScreen</string> <key>UIRequiredDeviceCapabilities</key> <array> <string>armv7</string> </array> <key>UIRequiresFullScreen</key> <false/> <key>UIStatusBarStyle</key> <string>UIStatusBarStyleDefault</string> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UIUserInterfaceStyle</key> <string>Light</string> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> </dict> </plist>
修复步骤
- 定位到项目中的Info.plist文件:
/Users/jayengineer/Workspace/react_projects/Breached/ios/Breached/Info.plist - 打开文件找到
CFBundleShortVersionString对应的行,将<string>1.0.4/string>修改为<string>1.0.4</string> - 保存文件后重新执行
npx expo run:ios
内容的提问来源于stack exchange,提问作者Jay Engineer
相关产品推荐
相关产品推荐

