I have a main project with some local packages. These packages are imported in the main project as features. I want to have an Analytics package that is a simple wrapper around Firebase Analytics that can be imported in some of those packages. The main target also has the Firebase Analytics package for legacy reasons.
I can import the package in my main project.
Somehow, I can build the project, but it fails to build for testing when the Analytics package is imported in other packages. Its giving errors like: Undefined symbol: _GULIsLoggableLevel.
I've tried to set the linkerFlag -ObjC on the package already, doesn't make a difference. What's going wrong? Do I need to change something in my test target of the main project?
This is my Package.swift:
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Analytics",
platforms: [.iOS(.v16), .macCatalyst(.v15)],
products: [
.library(
name: "Analytics",
targets: ["Analytics"])
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/firebase/firebase-ios-sdk.git", from: "11.12.0")
],
targets: [
.target(
name: "Analytics",
dependencies: [
.product(name: "FirebaseAnalytics", package: "firebase-ios-sdk")
]),
.testTarget(
name: "AnalyticsTests",
dependencies: ["Analytics"])
]
)
11.12.0version?