###概要
最近iOSでのフレームワーク開発を始めました。
構成として自作フレームワークの中にライブラリ2種を持たせるようにしています。
また、ライブラリの導入にはCarthageを利用しています。
Xcode7のときは正常に動作していました。
フレームワーク作成のタイミングでは特にエラーが出ていません。
作成したフレームワークを読み込んだアプリプロジェクトで実行した際にエラーが発生します。
シミュレータでは問題なくビルド及び実行ができています。
実機ではビルドは成功するのですが実行した直後にアプリが落ちてしまいます。
原因など心当たりある方教えていただけると助かります。
###環境
Xcode 8.0
Swift 3
iOS 9.3
Carthage 0.17.2
Deployment Target 9.0
フレームワーク生成時のスクリプト
https://gist.github.com/cromandini/1a9c4aeab27ca84f5d79#file-universal-framework-sh
###発生しているエラー
dyld: Library not loaded: @rpath/SwiftyJSON.framework/SwiftyJSON Referenced from: /private/var/containers/Bundle/Application/2863EB93-858E-4616-B7DF-0A6CEC90FF92/SampleApplication.app/Frameworks/SampleFramework.framework/SampleFramework Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/2863EB93-858E-4616-B7DF-0A6CEC90FF92/SampleApplication.app/Frameworks/SampleFramework.framework/Frameworks/SwiftyJSON.framework/SwiftyJSON: mmap() error 1 at address=0x1008C4000, size=0x00030000 segment=__TEXT in Segment::map() mapping /private/var/containers/Bundle/Application/2863EB93-858E-4616-B7DF-0A6CEC90FF92/SampleApplication.app/Frameworks/SampleFramework.framework/Frameworks/SwiftyJSON.framework/SwiftyJSON
import UIKit import Starscream import SwiftyJSON public class TestObject: NSObject { var websocket: WebSocket var json: JSON public init(string: String) { self.websocket = WebSocket(url: URL(string: "ws://localhost")!) self.json = JSON(data: Data()) print("TestObject: \(string)") } }
import UIKit import SampleFramework class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. _ = TestObject(string: "initialize") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
###試したこと
- Embedded Binariesへの追加
- bitcodeの対応(BITCODE_GENERATION_MODEの追加)
- Build Active Architecture OnlyをNOに変更
- Carthageを使わない
- ⌘+Shift+K
- Derived Dataの削除
...などなど
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。