2016-11-28 15 views
0

私は自分のプロジェクトでレルムを統合するのに苦労します。 実際、私は公式のドキュメンテーションのガイドラインに従っていますが、それは私を助けません。レルムのインストールXCode 8.1

私はRealmSwiftをインポートしようとしていますが、「いいえそのようなモジュール」があります。

import RealmSwift 

フレームワークRealm.frameworkは赤です。

enter image description here

は、ここに私のPodfile

# Uncomment this line to define a global platform for your project 
# platform :ios, '9.0' 

target 'RealmTest' do 
    # Comment this line if you're not using Swift and don't want to use dynamic frameworks 
    use_frameworks! 

    # Pods for RealmTest 
    pod 'RealmSwift' 

    target 'RealmTestTests' do 
    inherit! :search_paths 
    # Pods for testing 
    end 

    target 'RealmTestUITests' do 
    inherit! :search_paths 
    end 

    post_install do |installer| 
    installer.pods_project.targets.each do |target| 
     target.build_configurations.each do |config| 
     config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0' 
     # Pods for testing 
     end 
    end 
    end 
end 
+0

' 'target 'RealmTest' do'部分からPodfileの' post_install'部分を削除し、端末から 'pod install'を再度実行しますか? – AustinZ

+0

@AustinZは助けなかった –

+0

あなたのプロイエクトを構築して実行できますか?それが問題を解決するかもしれない。最初にプロジェクトをコンパイルすると、正しくインストールされていてもこのエラーが発生します。 – Orlando

答えて

1

が、私はそれを得るいくつかの問題が同様にインストールされていたです。これが答えではないかもしれないが、これらを通じて働いた後、私のプロジェクトが構築されています

ここで私は再びレルムをインストールCocoaPods

$ sudo gem install cocoapods 

を更新しなければならなかった類似の

# Uncomment the next line to define a global platform for your project 
# platform :ios, '9.0' 

target 'RealmTest' do 
    use_frameworks! 

    # Pods for RealmTest 
    pod ‘RealmSwift’ 

end 

post_install do |installer| 
    installer.pods_project.targets.each do |target| 
    target.build_configurations.each do |config| 
     config.build_settings['SWIFT_VERSION'] = '3.0' 
    end 
    end 
end 

である私のPodFileです、Xcodeを終了してから

ここから

.xcworkspace 

プロジェクトを開くためにCocoaPodsによって生成されたファイル。

最後の項目は、リンクされたフレームワークとライブラリセクションに2つのファイルを手動で追加することでした。

.xcworkspaceでプロジェクトを開き、左側の列でプロジェクトを選択します。その後、右側の[全般]を選択し、リンクされたフレームワークとライブラリを下にスクロールし、最後のステップは不要と思われるが、我々はそのステップをしたまで、私たちはビルドが仕事を得ることができなかったこの2つのファイル

Realm.framework 
RealmSwift.framework 

を追加します。

1

ああ! 実際にSwiftコンパイラに問題がありました - バージョン 誰も同じような問題を抱えていますが、ビルド設定 - スウィフトコンパイラ - バージョン - 古いSwift言語バージョンを使用してみてください -

関連する問題