Closed oonoo closed 8 years ago
The reason why you don't get the changes you refer to, is that they are on master and not in the latest release. You'd need to use Realm from master, what you can achieve by changing your dependency in your Podfile to:
pod 'RealmSwift', :head
Thank you for your answer. But the text of the changelog with the encryption improvements is for this explicit release https://github.com/realm/realm-cocoa/releases/tag/v0.96.3 If you download the source (https://github.com/realm/realm-cocoa/archive/v0.96.3.zip) you see it doesn't has the changes described in the changelog text right above the button to download the source. Maybe I am wrong here. But I think at last it is very misleading.
If I change my Podfile to:
pod 'RealmSwift', :head
I get compiler errors:
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/Migration.swift:169:40: error: cannot assign to property: 'objectSchema' is a 'let' constant objectSchema.accessorClass = MigrationObject.self
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/Migration.swift:173:39: error: cannot assign to property: 'objectSchema' is a 'let' constant
objectSchema.isSwiftClass = true
~~~~~~~~~~~~ ^
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/Migration.swift:176:40: error: cannot assign to property: 'objectSchema' is a 'let' constant
objectSchema.accessorClass = MigrationObject.self
~~~~~~~~~~~~ ^
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/ObjectSchema.swift:38:58: error: 'AnyObject' is not convertible to 'RLMProperty'; did you mean to use 'as!' to force downcast?
return rlmObjectSchema.properties.map { Property($0) }
^
as! RLMProperty
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/Realm.swift:104:43: error: invalid conversion from non-escaping function of type '@noescape () -> Void' to potentially escaping function type '() -> Void'
try rlmRealm.transactionWithBlock(block)
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/RealmConfiguration.swift:65:37: error: use of unresolved identifier 'RLMRealmPathForFile'
public init(path: String? = RLMRealmPathForFile("default.realm"),
/Users/onno.bergob/Desktop/Projects/iOS/medicalpark-ios/Pods/RealmSwift/RealmSwift/Schema.swift:39:56: error: cannot convert value of type '(RLMObjectSchema) -> ObjectSchema' to expected argument type '(AnyObject) -> ObjectSchema'
return rlmSchema.objectSchema.map(ObjectSchema.init)
I guessed it was because RealmSwift uses the wrong Realm version, so it tried
```
pod 'Realm', :head
pod 'RealmSwift', :head
```
and
```
pod 'Realm', :head
pod 'RealmSwift', '~> 0.96.3'
```
in my Podfile. But i get in both cases the same compiler errors:
Undefined symbols for architecture x86_64:
"realm::_impl::transaction::begin(realm::SharedGroup&, realm::ClientHistory&, realm::BindingContext_, bool)", referenced from:
realm::Realm::update_schema(std::__1::unique_ptr<realm::Schema, std::__1::default_delete<realm::Schema> >, unsigned long long) in shared_realm.o
realm::Realm::begin_transaction() in shared_realm.o
"realm::_impl::transaction::cancel(realm::SharedGroup&, realm::ClientHistory&, realm::BindingContext_)", referenced from:
realm::Realm::cancel_transaction() in shared_realm.o
"realm::_impl::transaction::commit(realm::SharedGroup&, realm::ClientHistory&, realm::BindingContext_)", referenced from:
realm::Realm::commit_transaction() in shared_realm.o
"realm::_impl::transaction::advance(realm::SharedGroup&, realm::ClientHistory&, realm::BindingContext_)", referenced from:
realm::Realm::notify() in shared_realm.o
realm::Realm::refresh() in shared_realm.o
"realm::_impl::ExternalCommitHelper::remove_realm(realm::Realm_)", referenced from:
realm::Realm::~Realm() in shared_realm.o
realm::Realm::close() in shared_realm.o
"realm::_impl::ExternalCommitHelper::notify_others()", referenced from:
realm::Realm::commit_transaction() in shared_realm.o
"realm::_impl::ExternalCommitHelper::add_realm(realm::Realm_)", referenced from:
realm::Realm::get_shared_realm(realm::Realm::Config) in shared_realm.o
"realm::_impl::ExternalCommitHelper::ExternalCommitHelper(realm::Realm_)", referenced from:
std::__1::shared_ptrrealm::_impl::ExternalCommitHelper std::__1::shared_ptrrealm::_impl::ExternalCommitHelper::make_shared<realm::Realm_>(realm::Realm*&&) in shared_realm.o
"realm::_impl::ExternalCommitHelper::~ExternalCommitHelper()", referenced from:
std::__1::__shared_ptr_emplace<realm::_impl::ExternalCommitHelper, std::__1::allocator<realm::_impl::ExternalCommitHelper> >::__on_zero_shared() in shared_realm.o
std::__1::__libcpp_compressed_pair_impstd::__1::allocator<realm::_impl::ExternalCommitHelper, realm::_impl::ExternalCommitHelper, 1u>::~__libcpp_compressed_pair_imp() in shared_realm.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This should be correct:
pod 'Realm', :head
pod 'RealmSwift', :head
It's important that both Realm
and RealmSwift
pods be exactly at the same version.
I'd encourage you to reset your CocoaPods to see if that resolves the issue:
rm -rf ~/Library/Caches/CocoaPods
rm -rf Pods
pod install
I did everything you wrote, but I still get these compiler errors (that start with the line "Undefined symbols for architecture x86_64:").
Do you see any warnings when running pod install
? Which version of CocoaPods do you use? Can you make sure to update and run the commands again with the latest version?
I used version 0.39.0 of cocoapod. As far as I can see, this is the latest version. This is the complete output when I run it after deleting the Pods folder etc.: updating local specs repositories Analyzing dependencies Downloading dependencies Installing ActionSheetPicker-3.0 (2.0.3) Installing Alamofire (3.0.0) Installing AlamofireObjectMapper (1.1.0) Installing CocoaLumberjack (2.2.0) Installing DACircularProgress (2.3.1) Installing DrawerController (1.1.0) Installing HockeySDK (3.8.2) Installing IOStickyHeader (0.2.2) Installing MBProgressHUD (0.9.1) Installing MWPhotoBrowser (2.1.1) Installing MZAppearance (1.1.6) Installing MZFormSheetPresentationController (2.2.0) Installing ObjectMapper (0.19) Installing Realm (HEAD based on 0.96.3) Installing RealmSwift (HEAD based on 0.96.3) Installing SDWebImage (3.7.3) Installing SVProgressHUD (1.1.3) Installing SwiftDate (1.2) Installing SwiftLocation (0.2.0) Installing Toucan (0.4.3) Installing UIColor-Hex-Swift (0.2.0) Generating Pods project Integrating client project Sending stats Pod installation complete! There are 15 dependencies from the Podfile and 21 total pods installed.
I also got the same 10 errors 'Undefined symbols for architecture x86_64:' (armv7 for device) while using
pod 'Realm', :head
pod 'RealmSwift', :head
I just tried that on newly created project with fresh installed cocoapods.
Okay, :head
is currently not working and I'd not recommend anymore to use it because it's using the latest submitted spec version. You'd need to specify instead the :git
repository to fetch the current source and podspec from master as seen below. Sorry for the confusion caused here!
pod 'Realm', :git => 'https://github.com/realm/realm-cocoa.git'
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git'
pod install
after changing your Podfile to that should be fine. Cleaning the build folder / deleting derived data and triggering a manual build of the target RealmSwift
might be necessary though.
When i build my app with cocoapods and this line in the pod file: pod 'RealmSwift', '~> 0.96.3' I get old source files in the Realm folder for example the RLMRealm.mm file without the encryption improvements (https://github.com/realm/realm-cocoa/pull/2874) that should be in this release version since they are mentioned in the changelog for this release.
Also I get the exception "Cannot open an encrypted Realm with a debugger attached to the process" when I want to run the app with Xcode.