Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10.0.0-beta.12] [iOS] ld: symbol(s) not found for architecture x86_64 #3189

Closed
voidrender opened this issue Sep 2, 2020 · 13 comments
Closed
Assignees

Comments

@voidrender
Copy link
Contributor

voidrender commented Sep 2, 2020

Goals

Build a React Native app using v10.0.0-beta.12.

Expected Results

iOS app builds and runs successfully.

Actual Results

Build fails with linker errors (undefined symbols) in libRealmJS.a. I have tried cleaning Xcode build directories, removing node_modules/, removing ios/Pods/, and reinstalling.

Note: Android builds and runs fine, so this is only an iOS issue.

Undefined symbols for architecture x86_64:
  "realm::Transaction::duplicate()", referenced from:
      realm::_impl::ResultsNotifier::do_prepare_handover(realm::Transaction&) in libRealmJS.a(results_notifier.o)
      realm::_impl::ResultsNotifier::prepare_to_deliver() in libRealmJS.a(results_notifier.o)
  "realm::TableVersions::operator==(realm::TableVersions const&) const", referenced from:
      realm::_impl::ResultsNotifier::need_to_run() in libRealmJS.a(results_notifier.o)
  "realm::util::File::try_remove(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      realm::SyncFileManager::remove_realm(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in libRealmJS.a(sync_file.o)
  "realm::util::try_remove_dir_recursive(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      realm::SyncFileManager::remove_user_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in libRealmJS.a(sync_file.o)
      realm::SyncFileManager::remove_realm(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in libRealmJS.a(sync_file.o)
      realm::SyncFileManager::remove_metadata_realm() const in libRealmJS.a(sync_file.o)
  "realm::ClusterTree::ConstIterator::operator++()", referenced from:
      realm::ClusterTree::Iterator::operator++() in libRealmJS.a(sync_metadata.o)
  "realm::Query::equal(realm::ColKey, realm::StringData, bool)", referenced from:
      realm::SyncMetadataManager::get_or_make_user_metadata(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const in libRealmJS.a(sync_metadata.o)
  "realm::ClusterTree::ConstIterator::operator->() const", referenced from:
      realm::ClusterTree::Iterator::operator->() const in libRealmJS.a(sync_metadata.o)
  "realm::Table::begin()", referenced from:
      realm::SyncMetadataManager::SyncMetadataManager(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, realm::util::Optional<std::__1::vector<char, std::__1::allocator<char> > >)::$_1::operator()() const in libRealmJS.a(sync_metadata.o)
      realm::SyncMetadataManager::get_current_user_identity() const in libRealmJS.a(sync_metadata.o)
      realm::SyncMetadataManager::set_current_user_identity(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libRealmJS.a(sync_metadata.o)
      realm::SyncMetadataManager::get_or_make_user_metadata(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const in libRealmJS.a(sync_metadata.o)
      realm::SyncMetadataManager::SyncMetadataManager(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, realm::util::Optional<std::__1::vector<char, std::__1::allocator<char> > >)::$_0::operator()(std::__1::shared_ptr<realm::Realm>, std::__1::shared_ptr<realm::Realm>, realm::Schema&) const in libRealmJS.a(sync_metadata.o)
  "realm::ConstTableView::average_decimal(realm::ColKey, unsigned long*) const", referenced from:
      realm::(anonymous namespace)::AggregateHelper<realm::Decimal128, realm::TableView&>::avg(realm::ColKey, unsigned long*) in libRealmJS.a(results.o)
  "realm::ConstTableView::average_int(realm::ColKey, unsigned long*) const", referenced from:
      realm::(anonymous namespace)::AggregateHelper<long long, realm::TableView&>::avg(realm::ColKey, unsigned long*) in libRealmJS.a(results.o)
  "realm::ConstTableView::average_float(realm::ColKey, unsigned long*) const", referenced from:
      realm::(anonymous namespace)::AggregateHelper<float, realm::TableView&>::avg(realm::ColKey, unsigned long*) in libRealmJS.a(results.o)
  "realm::Table::average_int(realm::ColKey, unsigned long*) const", referenced from:
      realm::(anonymous namespace)::AggregateHelper<long long, realm::Table const&>::avg(realm::ColKey, unsigned long*) in libRealmJS.a(results.o)

  (... many more omitted due to comment length limits)

  "realm::ConstLstIf<realm::Decimal128>::distinct(std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, realm::util::Optional<bool>) const", referenced from:
      vtable for realm::Lst<realm::Decimal128> in libRealmJS.a(thread_safe_reference.o)
      construction vtable for realm::ConstLstIf<realm::Decimal128>-in-realm::Lst<realm::Decimal128> in libRealmJS.a(thread_safe_reference.o)
  "realm::Obj& realm::Obj::set<realm::Timestamp>(realm::ColKey, realm::Timestamp, bool)", referenced from:
      void realm::(anonymous namespace)::ValueUpdater<OpaqueJSValue const*, realm::js::NativeAccessor<realm::jsc::Types> >::operator()<realm::Timestamp>(realm::Timestamp*) in libRealmJS.a(jsc_init.o)
      void realm::(anonymous namespace)::ValueUpdater<OpaqueJSValue const*, realm::js::NativeAccessor<realm::jsc::Types> >::operator()<realm::Timestamp>(realm::Timestamp*) in libRealmJS.a(rpc.o)
  "realm::Group::validate_primary_columns()", referenced from:
      realm::ObjectStore::apply_schema_changes(realm::Transaction&, unsigned long long, realm::Schema&, unsigned long long, realm::SchemaMode, std::__1::vector<realm::SchemaChange, std::__1::allocator<realm::SchemaChange> > const&, std::__1::function<void ()>) in libRealmJS.a(object_store.o)
  "realm::ConstLstIf<realm::Timestamp>::sort(std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, bool) const", referenced from:
      vtable for realm::Lst<realm::Timestamp> in libRealmJS.a(thread_safe_reference.o)
      construction vtable for realm::ConstLstIf<realm::Timestamp>-in-realm::Lst<realm::Timestamp> in libRealmJS.a(thread_safe_reference.o)
  "realm::LinkPathPart::LinkPathPart(realm::ColKey, realm::ConstTableRef)", referenced from:
      realm::query_builder::apply_ordering(realm::DescriptorOrdering&, realm::ConstTableRef, realm::parser::DescriptorOrderingState const&, realm::query_builder::Arguments&, realm::parser::KeyPathMapping) in librealm-parser-ios.a(query_builder.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to Reproduce

Repro case here: https://github.com/ioveracker/mongodb-realm-react-native-playground/tree/realm-v10.0.0-beta.12

  1. Install packages with yarn.
  2. Install iOS dependencies with cd ios && pod install (or use yarn setup:ios if you have rbenv and want to lock in the same ruby / bundler / cocoapods versions).
  3. Attempt to build and run the iOS app with yarn ios.

Code Sample

https://github.com/ioveracker/mongodb-realm-react-native-playground/tree/realm-v10.0.0-beta.12

Version of Realm and Tooling

  • Realm JS SDK Version: 10.0.0-beta.12
  • Node or React Native: React Native 0.63.2
  • Client OS & Version: macOS 10.15.5
  • Which debugger for React Native: N/A
  • Xcode version: 11.6
@rogerkerse
Copy link

Same issue for me

@kneth
Copy link
Contributor

kneth commented Sep 3, 2020

It is clearly a bug at our end.

Until we get a fix out, you can try to change librealm-ios.a to librealm-sync-ios.a in https://github.com/realm/realm-js/blob/v10/RealmJS.podspec#L94.

@RealmBot
Copy link
Collaborator

RealmBot commented Sep 3, 2020

➤ Kenneth Geisshirt commented:

PR: #3190

@kneth kneth closed this as completed Sep 3, 2020
@kneth
Copy link
Contributor

kneth commented Sep 3, 2020

The fix has been merged and we will release it soon.

@mxia
Copy link

mxia commented Sep 17, 2020

Any timeline on when beta13 will be released?

@euZebe
Copy link

euZebe commented Sep 18, 2020

@mxia it has been released today.

@mxia
Copy link

mxia commented Sep 18, 2020

@mxia it has been released today.

Thanks so much!

@praveen-wal
Copy link

@kneth Issue is still there in 10.0.0-rc.1. Getting below error.

Show Error

public class Order
ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphonesimulator'
Undefined symbols for architecture x86_64:
  "___isPlatformVersionAtLeast", referenced from:
      realm::util::terminate_internal(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in librealm-sync-ios.a(terminate.o)
      realm::util::(anonymous namespace)::ensure_reclaimer_thread_runs() in librealm-sync-ios.a(file_mapper.o)
      realm::util::network::SecureTransportErrorCategory::message(int) const in librealm-sync-ios.a(network_ssl.o)
      realm::util::network::ssl::Stream::verify_peer() in librealm-sync-ios.a(network_ssl.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
\```

</p>
</details>

Using `react-native@0.63.3` and `Xcode 10.1`.

@kneth
Copy link
Contributor

kneth commented Oct 6, 2020

@praveen-wal Thank you for reporting.

@kneth
Copy link
Contributor

kneth commented Oct 7, 2020

@praveen-wal We build for Xcode 11 and not Xcode 10. Please consider to upgrade :-)

@praveen-wal
Copy link

Sure @kneth. For now, I'm using [email protected], I am getting a different issue. This might not be related to the above issue.
I'm getting this error #3105.

@douglassthomas
Copy link

@kneth can you please make an update available for Xcode 10?
i also face the problem like this:

realm::util::(anonymous namespace)::ensure_reclaimer_thread_runs() in librealm-sync-ios.a(file_mapper.o)

realm::util::network::SecureTransportErrorCategory::message(int) const in librealm-sync-ios.a(network_ssl.o)

realm::util::network::ssl::Stream::verify_peer() in librealm-sync-ios.a(network_ssl.o)

@kneth
Copy link
Contributor

kneth commented Dec 11, 2020

@douglassthomas

can you please make an update available for Xcode 10?

Xcode 10 isn't supported by Apple.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants