realm / realm-swift

Realm is a mobile database: a replacement for Core Data & SQLite
https://realm.io
Apache License 2.0
16.34k stars 2.15k forks source link

Error message: error: 'realm-swift': product 'RealmCore' required by package 'realm-swift' target 'Realm' not found in package 'RealmDatabase'. #8161

Closed mrgrimme closed 1 year ago

mrgrimme commented 1 year ago

How frequently does the bug occur?

Always

Description

Hi, I don't know what I'm doing wrong, but I always get the message...

"product 'RealmCore' required by package 'realm-swift' target 'Realm' not found in package 'RealmDatabase'."

...when I want to build my swift/Xcode project from terminal. I cannot find a similar issue anywhere online. Please help me.

Here is a part of my Package.swift: ], dependencies: [ //AWS LAMBDA .package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", .upToNextMajor(from: "0.5.2")), .package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", .upToNextMajor(from: "0.1.0")), //REALM SWIFT .package(url: "https://github.com/realm/realm-swift.git", .upToNextMajor(from: "10.36.0")), .package(url: "https://github.com/realm/realm-core.git", .upToNextMajor(from: "13.0.0")), //SWIFT BSON .package(url: "https://github.com/mongodb/swift-bson.git", .upToNextMajor(from: "3.1.0")), //SWIFT-SERVER .package(url: "https://github.com/swift-server/swift-backtrace.git", .upToNextMajor(from: "1.3.3")), //SWIFT-LOG .package(url: "https://github.com/apple/swift-log.git", .upToNextMajor(from: "1.5.2")), //SWIFT-NIO .package(url: "https://github.com/apple/swift-nio.git", .upToNextMajor(from: "2.48.0")), .package(url: "https://github.com/apple/swift-nio-extras.git", .upToNextMajor(from: "1.17.0")), .package(url: "https://github.com/apple/swift-nio-http2.git", .upToNextMajor(from: "1.25.2")), .package(url: "https://github.com/apple/swift-nio-ssl.git", .upToNextMajor(from: "2.23.0")), .package(url: "https://github.com/apple/swift-nio-transport-services.git", .upToNextMajor(from: "1.15.0")), //SWIFT-METRICS .package(url: "https://github.com/apple/swift-metrics.git", .upToNextMajor(from: "2.3.4")), ], targets: [ .target( name: "MongoDbLambdaFunction", dependencies: [ .product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime", moduleAliases: ["AWSLambdaEvents": "AWSLambdaEventsRuntime"]), .product(name: "AWSLambdaEvents", package: "swift-aws-lambda-events"), .product(name: "NIO", package: "swift-nio"), .product(name: "NIOFoundationCompat", package: "swift-nio"), .product(name: "SwiftBSON", package: "swift-bson"), .product(name: "RealmSwift", package: "realm-swift"), .product(name: "RealmCore", package: "realm-core", condition: .when(platforms: [.macOS, .iOS, .tvOS, .watchOS])),**** .product(name: "Backtrace", package: "swift-backtrace"), .product(name: "Logging", package: "swift-log"), .product(name: "NIOExtras", package: "swift-nio-extras"), .product(name: "NIOHTTP1", package: "swift-nio"), .product(name: "NIOHTTP2", package: "swift-nio-http2"), .product(name: "NIOSSL", package: "swift-nio-ssl"), .product(name: "NIOTransportServices", package: "swift-nio-transport-services"), .product(name: "Metrics", package: "swift-metrics")], path: "Sources" ),

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

10.36.0

What Atlas Services are you using?

Atlas Device Sync

Are you using encryption?

Platform OS and version(s)

macOS for AWS LAMBDA

Build environment

Xcode version: ... Dependency manager and version: ...

dianaafanador3 commented 1 year ago

Hi @mrgrimme any reason you are adding realm-core directly as a dependency?, adding .package(url: "https://github.com/realm/realm-swift.git", .upToNextMajor(from: "10.36.0")) should directly pull the realm core version that works with that SDK version, unless you want to use directly RealmCore into your project/framework.