【问题标题】:XCode 7 dyld: Symbol not found after setting ENABLE_BITCODE=NOXCode 7 dyld:设置 ENABLE_BITCODE=NO 后找不到符号
【发布时间】:2015-07-10 14:51:40
【问题描述】:

我已经安装了 Xcode 7 beta 3,我可以在模拟器上运行我的代码,但不能在我的设备上运行。我无法构建并收到警告:

ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/Developer/Library/Frameworks'
ld: -bundle and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

所以我设置了 ENABLE_BITCODE=NO,现在设备构建了,但它因错误而崩溃:

dyld: Symbol not found: __TMdVSS5Index
  Referenced from: /private/var/mobile/Containers/Bundle/Application/75C6AF90-20D1-4CC7-B206-94C8FAD41DEF/BiggerCity.app/Frameworks/Alamofire.framework/Alamofire
  Expected in: /private/var/mobile/Containers/Bundle/Application/75C6AF90-20D1-4CC7-B206-94C8FAD41DEF/BiggerCity.app/Frameworks/libswiftCore.dylib
 in /private/var/mobile/Containers/Bundle/Application/75C6AF90-20D1-4CC7-B206-94C8FAD41DEF/BiggerCity.app/Frameworks/Alamofire.framework/Alamofire

我的 Podfile 是:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
pod 'PubNub', '3.7.10.8’

有谁知道导致此错误的原因是什么?自从我安装了 Xcode 7 后才出现这种情况。Xcode 6 运行良好。

【问题讨论】:

  • PubNub 最近发布了 4.0 版本。您请求 3.7 有什么原因吗?
  • 我还没有完全更新。这是我将要做的事情。

标签: ios xcode cocoapods bitcode


【解决方案1】:

我需要清理和删除派生数据。完成此操作后,我就可以在我的设备上运行我的应用程序了。

【讨论】:

    【解决方案2】:

    看起来您(而不是AlamoFire)正在使用 Swift,因此您需要在目标 Build Settings 中打开 Embedded Content Contains Swift Code,Xcode 将在构建应用程序时包含所有 Swift .dylib 文件。

    您可能使用了错误版本的AlamoFire 框架,因为使用此特定版本意味着.dylib 文件需要与应用程序捆绑在一起,因此您只能针对iOS 8+。我会寻找在 Objective-C 中实现的版本。

    【讨论】:

    • 如果您建议使用 Objective C 选项,AFNetworking(Alamofire 的 Obj-C 表亲)不是更合适吗?
    猜你喜欢
    • 1970-01-01
    • 2015-10-12
    • 2019-11-23
    • 2020-08-14
    • 2014-09-15
    • 1970-01-01
    • 2020-12-27
    • 1970-01-01
    • 2016-01-02
    相关资源
    最近更新 更多