ios - dyld : Library not loaded: code signature invalid

标签 ios swift iphone xcode

我正在尝试构建和运行一个使用 AVFoundation 框架的应用程序......
(我知道这是重复的,但其他地方发布的解决方案对我没有帮助。)
我构建成功,但是当我从 Xcode 重新运行它时应用程序崩溃并出现以下错误:

> dyld: Library not loaded: @rpath/libswiftAVFoundation.dylib
Referenced from : /private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/FaceMarks
Reason: no suitable image found. Did find:
/private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/Frameworks/libswiftAVfoundation.dylib:

>code signature invalid for '/private/var/containers/Bundle/Application/B9B93BB2-F55E-4DAE-A720-0F2D22A47278/FaceMarks.app/Frameworks/libswiftAVfoundation.dylib'

> lldb
完整的错误信息:
enter image description here
我找到了很多解决方案,我已经测试了很多,但所有这些都不适合我:
  1. Clean, build and run an application

  1. Set "Always Embed Swift Standard Libraries" to "Yes" under the Build Settings > Build Options

  1. Restart Xcode

  1. Restart the phone

  1. Reinstall the Xcode

  1. Testing other simple application on my iPhone ( App contains just a print function )

Note: That the test app works fine on the simulator but on my iPhone it gives the same error


迪尔德:库未加载:@rpath/libswiftCore.dylib
enter image description here

最佳答案

代码签名问题通常与帐户相关,因此如果您使用的是带有某些限制和过期问题的免费 Apple 开发帐户。

首先,确保您有一个有效且活跃的开发人员帐户登录到 Xcode 下:

Xcode | Preferences | Accounts 

或者删除那里显示的开发者帐户,然后重新添加。

其次,确保在 Preferences | 下指定的帐户帐户与您在以下项目中选择的项目目标相匹配:
<TargetName> | Signing & Capabilities

关于ios - dyld : Library not loaded: code signature invalid,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60384835/

相关文章:

iphone - 从 UISearchDisplayController 推送到新 View

ios - 将 NSMutableArray 添加到项目并在另一个类中访问相同的 NSMutableArray

iphone - 在 iOS 中自动创建图形(条形图和饼图)并将其转换为 pdf,而无需为图形创建 uiview

ios - XCode 7 自动布局约束 : How to make 2 images stay horizontally in the center

ios - 如何使用 ios swift 中的 sobel 边缘检测/canny 边缘检测在有限的边缘边界内使用钢笔工具为我的草图着色?

android - 使用 REST Api 的移动应用程序开发计划是个好主意吗?

ios - CompileSwiftSources 正常 x86_64 com.apple.xcode.tools.swift.compiler

ios - 重新加载 UITableView 数据而不重新定位 UITableViewCells

nsarray - Swift 中的元组数组

ios - 从 Nib 加载时 UIView 的帧大小?