Watchkit & Realm 0.92.3

☆樱花仙子☆ 提交于 2019-11-28 14:12:41
TomazStoiljkovic

I would recommend that you use CocoaPods.

I did it like you did, with dynamic frameworks, but when I try to submit my application to iTunes Connect using Xcode's Organizer, I could not because of the nested frameworks. Realm.framework is inside RealmSwift.framework, and that is not okay with Apple. So I try and try but nothing helped…

Then I used CocoaPods and everything worked as it should.

Here are instructions for CocoaPods installation:

Install CocoaPods 0.37.1 or later ([sudo] gem install cocoapods).
In your Podfile, add use_frameworks! and pod 'RealmSwift' to your main and test targets.
From the command line, run pod install.
Use the .xcworkspace file generated by CocoaPods to work on your project!

This Podfile finally did it for me (see below). Everything worked after that... To install just open a terminal, go to your App's folder (where you place the Podfile) and type

pos install

After that make sure to open from now on the "MyApp.xcworkspace" (no longer "MyApp.xcodeproj") and you are all set !

Here is the podfile that worked :

xcodeproj 'MyApp.xcodeproj'
workspace 'MyApp.xcworkspace'
platform :ios, '8.3'

source 'https://github.com/artsy/Specs.git'
source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!
link_with 'MyApp', 'MyApp WatchKit Extension'

def shared_pods
      pod 'RealmSwift', '>= 0.93.2'
end

target 'MyApp' do
    shared_pods
end

target 'MyAppTests' do
    shared_pods
end

target 'MyApp WatchKit Extension' do
    shared_pods
end
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!