Realm-cocoa: Problems with Realm when using cocoapods

Created on 22 Mar 2017  ·  2Comments  ·  Source: realm/realm-cocoa

Questions: Problems with Realm when using cocoa pods

I installed realm with cocoapods, but when I tried to build the project, Xcode shows several errors.

/Pods/Realm/Realm/ObjectStore/src/binding_callback_thread_observer.cpp:19:10: 'binding_callback_thread_observer.hpp' file not found

I searched in the whole project, find out that there is no .hpp file.
By the way, the project is using Swift 3.0
In pod file I wrote like this:

platform :ios, '9.0'
use_frameworks!

inhibit_all_warnings!

target 'SpiderSubscriberBIphone' do

# Rx家族
  pod 'RxSwift', '~> 3.3.1'
  pod 'RxBlocking', '~> 3.3.1'
  pod 'RxCocoa', '~> 3.3.1'
  pod 'Moya/RxSwift', '~> 8.0.3'
  pod 'RxRealm', '~> 0.5.2'
  pod 'RxDataSources', '1.0.3'
# 网络库
  pod 'Alamofire', '~> 4.4'
  pod 'Moya', '~> 8.0.3'
# Json 解析   
  pod 'EVReflection', '~> 4.5.0'
# 约束
  pod 'SnapKit', '~> 3.2'
# webImage
  pod 'Kingfisher', '~> 3.5.2'
# Toast
  pod 'Toaster', '~> 2.0'
# PlaceHodler
  pod 'StatefulViewController', '~> 3.0'
# 加载图
  pod 'PKHUD', '~> 4.0'
# HexColor
  pod 'HexColors', '5.0.1'
# 键盘管理
  pod 'IHKeyboardAvoiding', '~> 3.7'

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

Version of Realm and Tooling

Realm version: 2.4.4

Xcode version: Version 8.2.1 (8C1002)

iOS/OSX version: OSX 10.12.3 (16D32)

Dependency manager + version: cocoapods 1.2.0

T-Help

Most helpful comment

Hi @Elenionl. Thanks for reaching out about this. I could be wrong but I believe you're experiencing a problem that's more related to CocoaPods than it is Realm. If you're interested, you can read more about this issue here: https://github.com/CocoaPods/CocoaPods/issues/6454 and https://github.com/realm/realm-cocoa/issues/4614.

As for a workaround until they've fixed https://github.com/CocoaPods/CocoaPods/issues/6454, supposedly you can run the following commands:

#!/usr/bin/env bash

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

and try again. Please let me know if you have any issues or if this doesn't work and we can continue debugging or escalate this issue if necessary.

All 2 comments

Hi @Elenionl. Thanks for reaching out about this. I could be wrong but I believe you're experiencing a problem that's more related to CocoaPods than it is Realm. If you're interested, you can read more about this issue here: https://github.com/CocoaPods/CocoaPods/issues/6454 and https://github.com/realm/realm-cocoa/issues/4614.

As for a workaround until they've fixed https://github.com/CocoaPods/CocoaPods/issues/6454, supposedly you can run the following commands:

#!/usr/bin/env bash

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update

and try again. Please let me know if you have any issues or if this doesn't work and we can continue debugging or escalate this issue if necessary.

I use another computer to install pods and then compile the program. There is no error. Thank you !

Was this page helpful?
0 / 5 - 0 ratings