realm-swift: Realm error with cocoapods
Goals
I want to integrate Realm in my project. I tried to integrate realm via cocoapods, insert as dynamic and static library. I always get errors. One of them ‘Realm/Realm.h’ file not found.
Expected Results
After integrate Realm and build a project I don’t have any errors or warnings.
Actual Results
Project builds with errors. ‘Realm/Realm.h’ file not found. ld: file not found: /Users/marko1503/Library/Developer/Xcode/DerivedData/Test-ctnonttshetqagbeobrgiyokydhe/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/x86_64/AppDelegate.o clang: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to Reproduce
1). Create test project. 2). Add Realm dynamic framework from realm-objc-0.98.5/ios/dynamic/xcode-7/Realm.framework to the project (copy items flag enabled). 3). Open AppDelegate.m insert #import <Realm/Realm.h> at Top of the file. 4). Build test project. Project builded with success. 5). Integrate cocoapods to the project. I try with cocoapods 0.39 and 1.0 beta 6. Add podfile to you project folder, open terminal, navigate to the project folder, execute command pod install Pod file:
platform :ios, '8.0'
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!
target "You_test_project_name" do
# pod 'Realm'
end
6). Build you project. The project builded with error ‘Realm/Realm.h’ file not found. 7). Remove Realm static or dynamic framework. Add pod ‘Realm’ to pod file. Update you podfile with pod update. 8). Build you project. The project builded with error ‘Realm/Realm.h’ file not found and many more.
Code Sample
Version of Realm and Tooling
I use Xcode 7.3, Realm for iOS, dependency manager involved CocoaPods.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (6 by maintainers)
We can’t reproduce this from the samples given. One thing that’s reportedly helped in these cases is clearing the CocoaPods cache and Xcode’s Derived Data and trying to compile again. Could you please try doing this and reporting back again?