iOS应用程序与框架崩溃的设备,dyld:库未加载,Xcode 6 Beta [英] iOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta

查看:235
本文介绍了iOS应用程序与框架崩溃的设备,dyld:库未加载,Xcode 6 Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个崩溃是一个阻塞问题,基本上我使用以下步骤来重现问题:

This crash has been a blocking issue, basically I used following steps to reproduce the issue:


  • 创建Cocoa Touch Framework项目

  • 添加swift文件和类

  • 为设备创建框架

  • 在Swift中创建单一视图应用程序

  • 将框架导入应用程序项目

  • 在ViewController框架中实例化swift类

  • 在设备上构建并运行应用

  • Create a Cocoa Touch Framework project
  • Add a swift file and a class Dog
  • Build framework for device
  • Create a Single View application in Swift
  • Import framework into app project
  • Instantiate swift class from the framework in ViewController
  • Build and run app on device

应用立即在启动时崩溃,这里是控制台日志:

The app immediate crashed upon launching, here is console log:

dyld: Library not loaded: @rpath/FrameworkTest03.framework/FrameworkTest03
  Referenced from: /var/mobile/Applications/FA6BAAC8-1AAD-49B4-8326-F30F66458CB6/FrameworkTest03App.app/FrameworkTest03App
  Reason: image not found

我试图在iOS 7.1和8.0设备上构建,他们都有同样的崩溃。但我可以构建应用程序和运行在模拟器上罚款。另外,我知道我可以在链接二进制文件库中将框架从必需更改为可选,但它没有完全解决问题,当我创建的实例时,该应用程序崩溃。在设备和模拟器上的行为是不同的,我怀疑我们不能分发框架的设备使用beta版本的Xcode。

I have tried to build on iOS 7.1 and 8.0 devices, they both have the same crash. However I can build app and run on simulator fine. Also I am aware that I can change the framework to from Required to Optional in Link Binary With Libraries, but it did not completely resolve the problem, the app crashed when I create an instance of Dog. The behavior is different on device and simulator, I suspect that we can't distribute framework for device using beta version of Xcode. Can anyone shed light on this?

推荐答案

在目标的常规标签中,有一个嵌入二进制文件字段。当您添加框架时,崩溃已解决。

In the target's General tab, there is an Embedded Binaries field. When you add the framework there the crash is resolved.

参考是 Apple开发者论坛上的此处

这篇关于iOS应用程序与框架崩溃的设备,dyld:库未加载,Xcode 6 Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆