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

Xcode 14 beta fails when build a Realm v10.28.1 watchOS Target #7848

Closed
rubencalde opened this issue Jun 15, 2022 · 10 comments
Closed

Xcode 14 beta fails when build a Realm v10.28.1 watchOS Target #7848

rubencalde opened this issue Jun 15, 2022 · 10 comments

Comments

@rubencalde
Copy link

rubencalde commented Jun 15, 2022

How frequently does the bug occur?

All the time

Description

Hello,

When trying to build the Realm binary of a watchOS target, the build.sh script of the 10.28.1 version, returns the error described below:
ld: symbol(s) not found for architecture arm64

Is this error related to the Issue:

When you archive a watchOS app with the arm64e architecture enabled, it fails to build. (93550623)

which is one of the Known Issues on Xcode 14 beta Release Notes?

This behaviour it seems related by gongzhang post too, on #7829 (comment)

Is this commit, #7829, confirming that?:
disable watchos

Has anyone successfully built the Realm watchOS target with Xcode 14 beta?
Please, we need this problem to be solved as soon as possible. Not being able to compile the watchOS target with Xcode 14 is being very blocking for our work team. Thanks in advance.

Regards

Stacktrace & log output

...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for realm::TableView", referenced from:
      realm::TableView::TableView(realm::TableView&&) in RLMAccessor.o
      realm::TableView::~TableView() in RLMAccessor.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "non-virtual thunk to realm::ArrayIntNull::get_any(unsigned long) const", referenced from:
      vtable for realm::BPlusTree<realm::util::Optional<long long> >::LeafNode in RLMQueryUtil.o
  "non-virtual thunk to realm::ArrayInteger::get_any(unsigned long) const", referenced from:
      vtable for realm::BPlusTree<long long>::LeafNode in RLMQueryUtil.o
  "non-virtual thunk to realm::ArrayFixedBytes<realm::UUID, 16>::calc_byte_len(unsigned long, unsigned long) const", referenced from:
      vtable for realm::BPlusTree<realm::util::Optional<realm::UUID> >::LeafNode in RLMQueryUtil.o
      vtable for realm::BPlusTree<realm::UUID>::LeafNode in RLMQueryUtil.o
  "non-virtual thunk to realm::ArrayFixedBytes<realm::ObjectId, 12>::calc_byte_len(unsigned long, unsigned long) const", referenced from:
      vtable for realm::BPlusTree<realm::util::Optional<realm::ObjectId> >::LeafNode in RLMQueryUtil.o
      vtable for realm::BPlusTree<realm::ObjectId>::LeafNode in RLMQueryUtil.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **
The following build commands failed:
	Ld /Users/user/Desktop/realm-swift-10.28.1/build/DerivedData/Realm/Build/Intermediates.noindex/Realm.build/Release-watchos/Realm.build/Objects-normal/arm64/Binary/Realm normal arm64 (in target 'Realm' from project 'Realm')
(1 failure)

Can you reproduce the bug?

Yes, always

Reproduction Steps

Execute the script
build.sh xcframework watchos
on a Realm 10.28.1 version project

Version

10.28.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

watchOS 9

Build environment

Xcode version: 14 beta
Dependency manager and version: Cocoapods 1.10.2
macOS version: Monterey - 12.4

@rubencalde
Copy link
Author

Hi,

I'm getting the same error on Xcode 14 beta 2.
Is there any plan to fix this?

Regards

Rubén

Build environment
Xcode version: 14 beta 2
Dependency manager and version: Cocoapods 1.10.2
macOS version: Monterey - 12.4

@rubencalde
Copy link
Author

More info:

In addition to the problems described above, although it's possible to correctly build the watchOS target on Xcode 14, when validating a podspec of a project that has a dependency on RealmSwift, the following error is returned:

error: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically. Apply an Info.plist file to the target using the INFOPLIST_FILE build setting or generate one automatically by setting the GENERATE_INFOPLIST_FILE build setting to YES (recommended). (in target 'App' from project 'App')

Similarly, you also get the same error when validating the RealmSwift.podspec, with the following command:

pod spec lint ./RealmSwift.podspec --allow-warnings sources=master --verbose

It seems the same error described on CocoaPods/CocoaPods#11402

Build environment
Xcode version: 14 beta 2
Dependency manager and version: Cocoapods 1.10.2
macOS version: Monterey - 12.4

@tgoyne
Copy link
Member

tgoyne commented Jun 30, 2022

realm/realm-core#5577 adds a arm64 slice for watchOS to the prebuilt library. The workaround for using the current release is to remove the arm64 architecture from the supported architectures for your app.

@rubencalde
Copy link
Author

After getting the same error mentioned above, with RealmSwift 10.28.1:
error: Cannot code sign because the target does not have an Info.plist file and one is not being generated automatically. Apply an Info.plist file to the target using the INFOPLIST_FILE build setting or generate one automatically by setting the GENERATE_INFOPLIST_FILE build setting to YES (recommended). (in target 'App' from project 'App') ** BUILD FAILED **
We were able to fix this by updating to the latest version of CocoaPods, 1.11.3 with version 1.22.0 of the xcodeproj gem. In this way it has been possible to validate the RealmSwift podspec

Rubén

Build environment
Xcode version: 14 beta 2
Dependency manager and version: Cocoapods 1.11.3 + xcodeproj 1.22.0
macOS version: Monterey - 12.4

@jordimele
Copy link

Hello,

I have a similar problem, because when updating an existing application, which uses a watchOS target, to Xcode14 beta2 with RealmSwift 10.28.2, I cannot compile the application.

Build_error

@tgoyne Is it possible that version RealmSwift 10.28.2 does not have support for watchOS or tvOS?
possible issue

Are you working on solving the problem? Is there any workaround?

Thanks.

Build environment
Xcode 14 beta 2
Cocoapods 1.11.3
RealmSwift 10.28.2
macOS Monterey 12.4

@dianaafanador3
Copy link
Contributor

Hi @jordimele as mentioned on Xcode 14 Beta 2 release notes this is no longer supported.
* Building iOS projects with deployment targets for the armv7, armv7s, and i386 architectures is no longer supported. (92831716)

@dianaafanador3
Copy link
Contributor

Closing this, as this is working in our latest RealmSwift release v10.28.2, which updates core to v12.3.0 which fix this issue.

@mr-v
Copy link

mr-v commented Jul 8, 2022

@dianaafanador3 I'm still seeing the "ld: symbol(s) not found for architecture arm64" error both with v10.28.2 and latest master. This happens when I'm building for a device.

To reproduce:

A)
Build the watchOS target from installation examples (examples/installation/watchos/swift/CocoaPodsExample) with Xcode 14 beta 3:

image

B)

  • set the Xcode 14 beta 3 path as the active developer directory with xcode-select,
  • run ./build.sh xcframework watchos script.

@tgoyne tgoyne reopened this Jul 8, 2022
@tgoyne
Copy link
Member

tgoyne commented Jul 8, 2022

This is fixed in core master, which has not made it into a release yet.

@dianaafanador3
Copy link
Contributor

@mr-v fix Closing this as the fix was released in v10.28.4

@sync-by-unito sync-by-unito bot changed the title Xcode 14 beta fails when build a Realm v10.28.1 watchOS Target Xcode 14 beta fails when build a Realm v10.28.1 watchOS Target Feb 16, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 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

5 participants