You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Xcode构建报错:无法读取Info.plist,求配置排查方案

修复React Native iOS构建时Info.plist无法读取的错误

你的构建报错是由于Info.plist存在XML语法错误,具体问题出在NSMicrophoneUsageDescription的配置项上:

错误代码行:

<string>Enable Kidz-n-Motion access to your microphone during recording<string>

这里的<string>标签没有正确闭合,应该改为</string>。

修正后的完整配置代码如下:

<key>NSCameraUsageDescription</key>
<string>Enable Kidz-n-Motion access to your camera</string>

<key>NSPhotoLibraryAddUsageDescription</key>
<string>Enable Kidz-n-Motion access to add to your Photos</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>Enable Kidz-n-Motion access to your Camera Roll</string>

<key>NSMicrophoneUsageDescription</key>
<string>Enable Kidz-n-Motion access to your microphone during recording</string>

<key>UIAppFonts</key>
<array>
    <string>Gilroy-Black.ttf</string>
    <string>Gilroy-Bold.ttf</string>
    <string>Gilroy-ExtraBold.ttf</string>
    <string>Gilroy-Heavy.ttf</string>
    <string>Gilroy-Light.ttf</string>
    <string>Gilroy-Medium.ttf</string>
    <string>Gilroy-Regular.ttf</string>
    <string>Gilroy-SemiBold.ttf</string>
    <string>Gilroy-Thin.ttf</string>
    <string>Gilroy-UltraLight.ttf</string>
    <string>Lato-Bold.ttf</string>
    <string>Lato-Medium.ttf</string>
    <string>Lato-Regular.ttf</string>
    <string>Lato-Semibold.ttf</string>
    <string>LeagueSpartan-Bold.ttf</string>
    <string>LeagueSpartan-Medium.ttf</string>
    <string>LeagueSpartan-Regular.ttf</string>
    <string>LeagueSpartan-SemiBold.ttf</string>
    <string>Spartan-Black.ttf</string>
    <string>Spartan-Bold.ttf</string>
    <string>Spartan-ExtraBold.ttf</string>
    <string>Spartan-ExtraLight.ttf</string>
    <string>Spartan-Light.ttf</string>
    <string>Spartan-Medium.ttf</string>
    <string>Spartan-Regular.ttf</string>
    <string>Spartan-SemiBold.ttf</string>
    <string>Spartan-Thin.ttf</string>
</array>

后续检查技巧

  • 用Xcode打开Info.plist时,优先使用Property List Editor模式(右键文件选择Open As -> Property List),该模式会自动校验语法,避免手动编写XML时出现标签不闭合、格式错误。
  • 若必须手动编辑XML,可通过终端执行plutil -lint /path/to/your/Info.plist命令,工具会直接定位语法错误的位置。

内容的提问来源于stack exchange,提问作者user18899735

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 22:05:27