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

React Expo构建iOS应用时SENTSDK Pod缺失Info.plist报错求助

解决Expo裸工程中SENTSDK Pod编译时Info.plist缺失问题

以下是针对该问题的分步解决方案:

1. 重新安装Pod,确保依赖完整性

  • 删除iOS目录下的Pods文件夹和Podfile.lock文件
  • 进入iOS目录:cd ios
  • 执行Pod清理命令:pod deintegrate
  • 重新安装Pod:pod install(或使用Expo推荐的npx pod-install)
  • 完成后回到项目根目录,重新执行npx expo run:ios

如果重新安装后问题依旧,说明Pod本身的XCFramework包可能存在缺失,继续以下步骤。

2. 手动创建缺失的Info.plist文件

在路径/Users/username/Documents/Projects/sentiance-rn-expo/ios/Pods/SENTSDK/SENTSDK.xcframework下创建Info.plist文件,内容可参考标准XCFramework配置(根据实际SDK版本调整版本号):

<?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>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleIdentifier</key>
    <string>com.sentiance.sdk</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>SENTSDK</string>
    <key>CFBundlePackageType</key>
    <string>XFWK</string>
    <key>CFBundleShortVersionString</key>
    <string>5.0.0</string>
    <key>CFBundleVersion</key>
    <string>5.0.0</string>
    <key>MinimumOSVersion</key>
    <string>12.0</string>
</dict>
</plist>

创建完成后重新执行构建命令。

3. 检查Pod兼容性并修复配置

  • 确认@sentiance-react-native/core版本是否支持Expo裸工程,尝试升级或降级到官方标注兼容Expo的版本
  • 若兼容性存在问题,可在iOS目录的Podfile中添加post_install钩子,自动生成缺失的Info.plist:
post_install do |installer|
  installer.pods_project.targets.each do |target|
    next unless target.name == 'SENTSDK'
    xcframework_path = target.product_reference.real_path
    info_plist_path = File.join(xcframework_path, 'Info.plist')
    next if File.exist?(info_plist_path)
    
    File.write(info_plist_path, <<~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>CFBundleDevelopmentRegion</key>
          <string>en</string>
          <key>CFBundleIdentifier</key>
          <string>com.sentiance.sdk</string>
          <key>CFBundleInfoDictionaryVersion</key>
          <string>6.0</string>
          <key>CFBundleName</key>
          <string>SENTSDK</string>
          <key>CFBundlePackageType</key>
          <string>XFWK</string>
          <key>CFBundleShortVersionString</key>
          <string>5.0.0</string>
          <key>CFBundleVersion</key>
          <string>5.0.0</string>
          <key>MinimumOSVersion</key>
          <string>12.0</string>
      </dict>
      </plist>
    PLIST
  end
end

修改Podfile后重新执行pod install和构建命令。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.30 08:07:44