PebbleKit iOS SDK dynamic framework 問題

最近 EverLearn の Pebble アプリがiOSアプリと接続できずエラーが表示されるので、重い腰を上げて PebbleKit iOSを最新に上げてみた。
cocoapod を使っているので pod install で更新されるのだが、pod install するたびに Xcodeの Build Settings > Build Active Architecture Only が YES になるので、まずその設定を NO に修正。
これでビルドは通るようになるのだが、次に今までみたことがないエラーが表示された。
dyld: Library not loaded: @rpath/PebbleKit.framework/PebbleKit Referenced from: /var/mobile/Containers/Bundle/Application/…
Reason: image not found
結局この解決に1日使ってしまったが、
pebble/pebble-ios-sdk at 3.1.1: iOS PebbleKit SDK to talk to the Pebble via Bluetooth をみると
PebbleKit is now a dynamic framework. とある。
いろいろ調べたところ iOS8からそれまでは OS Xでしか利用できなかった dynamic framework が利用可能になったらしい。 Swift をサポートするためには dynamic framework でなければいけないようで、PebbleKit iOSはSwift対応したのでその際に dynamic framework 対応もされたらしい。
そして、dynamic framework を利用するためには General > Embedded Binaries に PebbleKit.framework を追加しないといけないらしい。
Embedded Binaries with iOS Framework – Stack Overflow
ということで、今は動くようになった。
しかし Pebble のBluetooth 接続がおかしいので Reset したら、PebbleのUpdate Server が止まっているらしく復旧ができなくなってしまった。
困るので早く直して下さい Pebble.
2016/02/28 更新
その後Pebbleのサポートに連絡してみたところ、iPhone側をリセットすることで解決できた。サーバー側の問題ではなかったようだ。 Pebble Update Server Error 問題 | tokentoken.com
そして Dynamic framework 問題だが、PebbleKit Framework をダウンロードして解決したと思ったら、App Storeへのアップロード時に問題が発生してしまった。 
Pebbleサポートに問い合わせしたところ、Frameworkファイルを直接組み込んだ場合は、自分で不要なものを strip しないといけないらしい。
He has to strip the framework from the simulator architectures before sending it to the App Store. Cocoapods and Carthage do this for you. You can use the Carthage method instead of creating your own script: https://github.com/Carthage/Carthage and look for step 4 for the `carthage copy-frameworks` build phase.
cocoapod を使えばその処理は不要だというので、以前失敗したのだが… と思いつつ再度試したところ、今回はなぜか大丈夫だった。
ということで今は cocoapod を使ってビルドもApp Storeへのuploadでもできている。以前なぜできなかったのかは不明だ。
関連記事
-
-
NSInternalInconsistencyException
久しぶりにiOS6以前のアプリをビルドしたら NSInternalInconsistencyExce
-
-
Pebble 1/23(水) から出荷開始
Pebble: E-Paper Watch for iPhone and Android by Pe
-
-
[iPad開発本] Beginning iPad Development
まだ数が少ないiPad開発本がApressから出たみたい。(Beginning of iPad De
-
-
iPhoneアプリ おんぷちゃん開発日記 和音表示
自分の娘のために作った五線譜学習アプリ「おんぷちゃん」の開発を細々と続けている。 iPadのグランド
-
-
[iPhone SDK] UILabel からポップアップメニューを表示してみる
今作っているアプリに UILabel を複数置いた画面があるが、その UILabelたちは編集
-
-
[iOS10] NSPhotoLibraryUsageDescription
iOS10 になってから App Store にアプリのSubmitを行ったところ、アプリのアップロ
-
-
iPhone 6 Plus iSight カメラ交換プログラムに行ってきた
iPhone 6 Plus iSight カメラ交換プログラム - Apple サポート の発表があ
-
-
達人出版会の本をKindleで読んでみる(Windows編)
最近話題の「当事者」の時代の電子書籍版(パブー)や、エキスパート Objective-C プログラミ
-
-
NSURLConnnection オブジェクトをいつ解放するか 2011/08/06
NSURLConnection の -[NSURLConnection initWithReque