weichsel / ZIPFoundation

Effortless ZIP Handling in Swift
MIT License
2.34k stars 262 forks source link

Could not find module 'ZipFoundation' for target 'x86_64_apple-ios-simulator' #298

Closed stefprogovac closed 11 months ago

stefprogovac commented 1 year ago

Summary

Using SPM with Xcode 15 and Apple M2 chip. SPM is as follows:

// swift-tools-version:5.0 import PackageDescription

if canImport(Compression)

let targets: [Target] = [ .target(name: "ZIPFoundation"), .testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"]) ]

else

let targets: [Target] = [ .systemLibrary(name: "CZLib", pkgConfig: "zlib", providers: [.brew(["zlib"]), .apt(["zlib"])]), .target(name: "ZIPFoundation", dependencies: ["CZLib"], cSettings: [.define("_GNU_SOURCE", to: "1")]), .testTarget(name: "ZIPFoundationTests", dependencies: ["ZIPFoundation"]) ]

endif

let package = Package( name: "ZIPFoundation", platforms: [ .macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2) ], products: [ .library(name: "ZIPFoundation", targets: ["ZIPFoundation"]) ], targets: targets, swiftLanguageVersions: [.v4, .v4_2, .v5] )

Steps to Reproduce

Expected Results

Be able to find Module

Actual Results

Now need to use Rosetta when building, while using Rosetta everything works fine.

Regression & Version

Not sure

Related Link

weichsel commented 1 year ago

You posted ZIPFoundation's package manifest. But how does yours look like? Did you add the library using Xcode's "Add Package" UI?

stefprogovac commented 1 year ago

Yes, see screenshot

Screenshot 2023-10-05 at 16 28 39
weichsel commented 1 year ago

Did you add ZIPFoundation to the "Frameworks and Libraries" list in the "General" tab of your target?

stefprogovac commented 1 year ago

Yes, you can see it right at the bottom:

Screenshot 2023-10-06 at 11 20 45
weichsel commented 1 year ago

Are you using any custom Swift toolchains?

weichsel commented 1 year ago

Another thought: Your issue title says

Could not find module 'ZipFoundation' for target 'x86_64_apple-ios-simulator'

Why are you building for an x86_64 Simulator on a Apple Silicon Mac?