Xcode 11.3.1加载路径为bundle的Info.plist文件失败

11

我有一个React Native项目,在将Xcode升级到11.3.1版本后停止工作。错误如下:

Could not install at this time.
Failed to load Info.plist from bundle at path /Users/dmytro/Library/Developer/CoreSimulator/Devices/F0BD5650-04A4-4534-B3F6-56B74ED1B0C2/data/Library/Caches/com.apple.mobile.installd.staging/temp.aRWRdh/extracted/Target.app/Frameworks/RCTVibration.framework; Extra info about plist: ACL=<not found

在此输入图片描述

并提供详细信息

Details

This app could not be installed at this time.
Domain: IXUserPresentableErrorDomain
Code: 1
Failure Reason: Could not install at this time.
Recovery Suggestion: Failed to load Info.plist from bundle at path /Users/dmytro/Library/Developer/CoreSimulator/Devices/F0BD5650-04A4-4534-B3F6-56B74ED1B0C2/data/Library/Caches/com.apple.mobile.installd.staging/temp.aRWRdh/extracted/Target.app/Frameworks/RCTVibration.framework; Extra info about plist: ACL=<not found> 
--
Failed to load Info.plist from bundle at path /Users/dmytro/Library/Developer/CoreSimulator/Devices/F0BD5650-04A4-4534-B3F6-56B74ED1B0C2/data/Library/Caches/com.apple.mobile.installd.staging/temp.aRWRdh/extracted/Target.app/Frameworks/RCTVibration.framework; Extra info about plist: ACL=<not found> 
Domain: MIInstallerErrorDomain
Code: 35
User Info: {
    FunctionName = "-[MIBundle _validateWithError:]";
    LegacyErrorString = PackageInspectionFailed;
    SourceFileLine = 128;
}
--

enter image description here

5个回答

32

使用 CocoaPods v1.9+,如果您无法从 Podfile 中删除use_frameworks!,您可以设置:

use_frameworks! :linkage => :static

现在Swift支持静态链接,CocoaPods已将此DSL扩展为允许指定首选联接类型。
来源:https://blog.cocoapods.org/CocoaPods-1.9.0-beta/

2
添加 :linkage => :static 会有什么后果吗? - SamB
谢谢,伙计。花了很多时间,最终它起作用了。但我的疑虑也是一样的。这会有什么后果吗? - Ravi
1
@Ravi 没问题!我想不会,因为Cocoapods使用它将生成带有静态链接库和模块映射文件的完整框架。 - Maycon Mesquita

6

对我来说解决方案是从Podfile中删除use_frameworks!

不要忘记运行pod install,清除Derived Data并在模拟器上Erase All Content And Settings


我遇到了同样的问题,但在我的情况下,我需要强制使用 use_frameworks!,寻找解决方案已经将近一天了。但是仍然没有头绪。 - Jothi Kannan
@JothiKannan 自 CocoaPods 1.5 版本以来,不需要使用 use_frameworks!,请参考 http://blog.cocoapods.org/CocoaPods-1.5.0/。你为什么需要它呢? - Dima Portenko
我正在使用 https://pushy.me/docs/additional-platforms/react-native 这个推送通知 SDK,它需要 use_frameworks! - Jothi Kannan
1
我没有使用过它,我的建议是尝试将Cocoapods更新到最新版本并尝试在不使用use_frameworks!的情况下使用它。 - Dima Portenko
1
我尝试过了,我有Cocopod 1.9.1,并且尝试了不使用use_frameworks!,结果出现了很多错误。 - Jothi Kannan

1

0

在Pod v1.11.2中遇到了同样的问题。我尝试重新启动模拟器、擦除内容、重启机器,从文件->工作区设置 -> {派生数据}中删除派生数据。

对我来说都没有用。最后,以下神奇的步骤帮助了我:

  1. 在pod文件中将'use_frameworks!'替换为'use_frameworks! :linkage => :static'
  2. 运行'pod install' //现在你可能会遇到其他问题
  3. 恢复'use_frameworks! :linkage => :static'更改,即将'use_frameworks! :linkage => :static'替换为'use_frameworks!'
  4. 再次运行'pod install'

0

前往 YourTarget > Build Settings > Packaging > Info.plist File,检查你的 .plist 文件路径。

同时清空你的 derived data 文件夹,并重新构建项目。


谢谢您的回答,但 Info.plist 的设置是正确的。错误指向了 Pods 库,所以问题可能与 Pods 有关。 - Dima Portenko
可能是因为有两个Plist文件。删除其中一个。此外,在重新启动Xcode后,尝试在xcodeproj中为plist提供路径,在某个地方最初可以给出路径。 - nazaif

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接