realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.81k stars 578 forks source link

Realm v12.6.2 with React Native v0.73.5, getting link error in iOS build compile #6540

Open sivaprasadkv opened 8 months ago

sivaprasadkv commented 8 months ago

While adding the latest Realm node module v12.6.2, there is a bug from iOS app, linking issue. Please suggest the workaround / solution to this issue.

Realm_React_Native_iOS_link_error
Undefined symbols for architecture arm64:
  "_objc_msgSend$allBundles", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$countByEnumeratingWithState:objects:count:", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$stringByAppendingPathComponent:", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$enumeratorAtPath:", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$copyItemAtPath:toPath:error:", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$userInfo", referenced from:
      error_description(NSError*) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$pathExtension", referenced from:
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$isEqualToString:", referenced from:
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$stringWithUTF8String:", referenced from:
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$code", referenced from:
      realm::JsPlatformHelpers::remove_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$createDirectoryAtPath:withIntermediateDirectories:attributes:error:", referenced from:
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$objectForKeyedSubscript:", referenced from:
      error_description(NSError*) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$containsString:", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$defaultManager", referenced from:
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$stringByDeletingLastPathComponent", referenced from:
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$fileExistsAtPath:", referenced from:
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$removeItemAtPath:error:", referenced from:
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$localizedDescription", referenced from:
      error_description(NSError*) in librealm-js-ios.a(platform.o)
  "_objc_msgSend$objectAtIndexedSubscript:", referenced from:
      realm::JsPlatformHelpers::default_realm_file_directory() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$resourcePath", referenced from:
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
  "_objc_msgSend$UTF8String", referenced from:
      realm::JsPlatformHelpers::default_realm_file_directory() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::ensure_directory_exists_for_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::copy_bundled_realm_files() in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_realm_files_from_directory(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
      realm::JsPlatformHelpers::remove_file(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in librealm-js-ios.a(platform.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
sync-by-unito[bot] commented 8 months ago

➤ PM Bot commented:

Jira ticket: RJS-2751

sivaprasadkv commented 8 months ago

Any help please. Almost 2 days got wasted on this issue. I tried React Native Template Realm (https://github.com/realm/realm-js/tree/main/templates/react-native-template#readme). Even this also throws the above error in iOS app. Not able to proceed further due to this blocker issue. It could be most appreciated for your suggestions.

Thanks in advance.