So I'm trying to set up a multi-module application with Tuist, and I'm unable to build it.
I get a series of these errors with different
[REDACTED]/Tuist/Dependencies/SwiftPackageManager/.build/checkouts/sentry-cocoa/Sources/Sentry/Public/SentryDefines.h:104:28 Redefinition of 'SentryLogLevel'
I've tried various build settings, as well as clean fetches and the like.
It looks like some people are having similar problems in this Issue.
As you can see I've tried the recommended settings, to no avail.
Here's Dependencies.swift:
var swiftPackageManagerDependencies = SwiftPackageManagerDependencies([
.remote(
url: "https://github.com/getsentry/sentry-cocoa.git",
requirement: .upToNextMajor(from: "8.19.0")
),
.remote(
url: "https://github.com/Alamofire/Alamofire.git",
requirement: .upToNextMajor(from: "5.8.1")
),
.remote(
url: "https://github.com/auth0/Auth0.swift",
requirement: .upToNextMajor(from: "2.5.0")
),
.remote(
url: "https://github.com/firebase/firebase-ios-sdk.git",
requirement: .upToNextMajor(from: "10.20.0")
)
]
)
let dependencies = Dependencies(
swiftPackageManager: swiftPackageManagerDependencies,
platforms: [.iOS]
)
Project.swift
import ProjectDescription
import ProjectDescriptionHelpers
let projectSettings: Settings = .settings(
base: [
"CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER": "NO",
"CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES": "YES",
"OTHER_SWIFT_FLAGS": "-Xcc -Wno-error=non-modular-include-in-framework-module"
]
)
let targetSettings: Settings = .settings(
base: [
"USE_HEADERMAP": "YES",
"OTHER_LDFLAGS": "-ObjC",
"HEADER_SEARCH_PATHS": ["$(inherited)",
"Tuist/Dependencies/SwiftPackageManager/.build/checkouts/sentry-cocoa/Sources/Sentry/**"]
]
)
let project = Project(
name: "CoreData",
// settings: projectSettings,
targets: [
Target(
name: "CoreData",
destinations: .iOS,
product: .framework,
bundleId: "domain.coredata",
sources: ["Sources/**"],
resources: ["Resources/**"],
dependencies: [
.external(name: "Alamofire", condition: nil),
.external(name: "Auth0", condition: nil),
.external(name: "FirebaseMessaging", condition: nil),
.external(name: "Sentry", condition: nil)
],
settings: targetSettings
),
Target(
name: "CoreDatatests",
destinations: .iOS,
product: .unitTests,
bundleId: "domain.coredata.tests",
sources: ["Tests/**"],
resources: ["Resources/**"],
dependencies: [
.target(name: "CoreData", condition: .none)
]
)
]
)