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

Unit Test: Undefined symbol: _$s10RealmSwift0A0V13ConfigurationV07defaultC0AEvgZ #8665

Open
paparotnick opened this issue Aug 7, 2024 · 5 comments

Comments

@paparotnick
Copy link

paparotnick commented Aug 7, 2024

How frequently does the bug occur?

Always

Description

  1. Goals

Use RealmSwift in Unit Tests + version above 10.48.1 + installed via Package.swift file

  1. Expected results

Successfully build Unit Tests target

  1. Actual results:

If I just build main target - it's building successfully
If I run unit tests - I'm getting 20 errors like Undefined symbol: _$s10RealmSwift0A0V13ConfigurationV07defaultC0AEvgZ

Screenshot 2024-08-07 at 17 04 27

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

  1. Important - I caught the issue only from version 10.48.2. On 10.48.1 and before all works as expected
  2. Specify in Package.swift: .package(url: "https://github.com/realm/realm-swift.git", .exactItem(Version(10, 48, 2))),
  3. Link RealmSwift product to target in Package.swift: .product(name: "RealmSwift", package: "realm-swift"),
  4. Run Unit Tests

Version

10.48.2

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 15+

Build environment

ProductName: macOS
ProductVersion: 14.5
BuildVersion: 23F79

/Applications/Xcode15.4.app/Contents/Developer
Xcode 15.4
Build version 15F31d

/opt/homebrew/opt/ruby/bin/pod
1.15.2

/bin/bash
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)

carthage not found
(not in use here)

/usr/bin/git
git version 2.39.3 (Apple Git-146)

Copy link

sync-by-unito bot commented Aug 7, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2420

@paparotnick paparotnick changed the title Undefined symbol: _$s10RealmSwift0A0V13ConfigurationV07defaultC0AEvgZ Unit Test: Undefined symbol: _$s10RealmSwift0A0V13ConfigurationV07defaultC0AEvgZ Aug 8, 2024
@paparotnick
Copy link
Author

paparotnick commented Aug 14, 2024

I'm still trying to fix this issue and now have more context:

  1. If I add RealmSwift via Cocoapods it works well. But it's not the solution for me, as I cannot use cocoa pods for this project.
  2. If I add RealmSwift via SPM NOT to Package.swift, but directly to the target, it shows the same errors
  3. I tried to create a new project with Unit Tests and add RealmSwift via SPM (version 10.52.3). After I added only one line: Realm.Configuration.defaultConfiguration.inMemoryIdentifier = self.name it start showing me same type of errors (on a screenshot)
Screenshot 2024-08-14 at 12 11 31

Important part: I've added RealmSwift as on screenshot
Screenshot 2024-08-14 at 12 30 41

Could it be some issue with my local machine configuration?

@paparotnick
Copy link
Author

Also attaching test project, where I could reproduce the error, please check

Test_realm.zip

@paparotnick
Copy link
Author

Checked the latest version of Realm (20.0.0) - the issue is the same.
Are there any updates?

@dpasirst
Copy link

I'm experiencing the same issue when it comes to unit tests. I too use SPM. I can also confirm that things work for me with 10.48.1 but not with newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants