-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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.49.3 failing to Build after updating using SPM.error: "but cannot be built dynamically because there is a package product with the same name." #8566
Comments
➤ PM Bot commented: Jira ticket: RCOCOA-2346 |
EditAs explained by @nirinchev below, we needed to remove an explicit dependency on Realm in our targets and we've now resolved this. This was an unexpected dev experience for us since we hadn't touched Realm in a number of years weren't anticipating a breakage of this kind. Original+1 All of our builds on MS AppCenter started consistently failing a few days ago with this error, downgrading Realm to 10.33.x seemed to help Here are snippets from our AppCenter configuration logs if it helps with a repro
|
I believe this exact error message is covered in the release notes of 10.49.3: https://github.com/realm/realm-swift/releases/tag/v10.49.3 Have you made sure that your targets only depend on RealmSwift or Realm? |
The motivation behind this change is laid out in this PR: #8561. We agree that this is not ideal DX, but it's the best we could come up under the circumstances (Apple requiring a privacy manifest for Realm, while Xcode not merging the privacy manifests for static frameworks correctly). |
Someone at Realm frontend might want to edit the official documentation on the website : https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/install/#installation. It stills says
|
Yes, we have it on our todo list - in this case we had to rush the release out to comply with Apple's May 1st deadline. |
I think you're seeing a cached version - if you reload the page, you should see that this has been updated:
|
Thanks @dacharyc, I can confirm after force reloading the page I see the updated instructions: |
How do you deal with this with Realm dependencies? I've been dealing with this issue for a few hours now in a big project with lots of dependencies and no matter what I do I always get the error "Swift package target 'Realm' ... cannot be built dynamically because there is a package product with the same name.". For instance, I just created a new project from scratch and the only thing that I did is to add RxRealm https://github.com/RxSwiftCommunity/RxRealm: And the error appears (the project is called "realm-rxrealm"): RxRealm installed these dependencies: And the only library is RxRealm: I cannot add Realm or RealmSwift as a dynamic framework because it doesn't appear: Is this something that RxRealm should handle or am I missing something? Another thing I tried is to add RealmSwift to the project alongside RxRealm: But the error keeps appearing. I created a separate project only with RealmSwift and I get no errors. So I assume something needs to be changed in RxRealm project. Their Swift.package has all these:
Am I right in thinking that |
Update on dependencies (see previous message): I forked RxRealm and I removed "Realm" but kept "RealmSwift" on every target and removed it from Package.swift. This solved the issue and I get no errors now. Inside the library "RealmSwift" is marked as "Do Not Embed". So I assume that I will have to manually supply the Manifest myself in my project. |
Thank you @lluisgerard 👍 The error message is confusing. I would probably spend hours trying to figure that out myself without realizing it is due to other dependencies that depend on Realm |
How frequently does the bug occur?
Always
Description
Overview
I was using Cocoapods for integrating relm.
after updating to xcode 15.3
I removed the cocoapods properly and integrated Realm using Swift Package Manager.
I have installed the Version v10.49.3 of the realm-swift package.
as soon as I try to build the project I get an error :-
Error Message
"Build failed: Swift package target 'Realm' is linked as a static library by 'TeddyTonk' and 'Realm', but cannot be built dynamically because there is a package product with the same name."
1.Goals
successfully Integrate realm-swift in xcode 15.3 using SPM.
2.Expected results
The project to Build Properly.
3.Actual results
Unable to Build the project.
4.Steps to reproduce
Install realm- swift v10.49.3 using SPM in xcode 15.3.
build the project.
5.Versions
Xcode - 15.3
realm-swift - v10.49.3
Mac OS - 14.4.1
6.Dependency manager used
Swift Package manager
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
STEP 1: Install realm- swift v10.49.3 using SPM in xcode 15.3.
STEP 2: build the project.
Version
v10.49.3
What Atlas Services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
Xcode - 15.3, realm-swift - v10.49.3, Mac OS - 14.4.1
Build environment
Xcode version: 15.3
Dependency manager and version: SPM
The text was updated successfully, but these errors were encountered: