最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - SwiftUI Preview Fails to Load While Project Builds and Runs Fine: Alamofire Module Map Issue - Stack Overflow

programmeradmin3浏览0评论

I'm having an issue specifically with SwiftUI previews in my iOS project. The project builds and runs fine on devices and simulators (in Rosetta mode), but SwiftUI previews fail to load in both Rosetta and native arm64 simulator environments. The main error in the preview is related to the Alamofire dependency in my SiriKit Intents extension:

Module map file '[DerivedData path]/Build/Products/Debug-iphonesimulator/Alamofire/Alamofire.modulemap' not found

This error repeats for multiple Swift files within my SiriKit Intents extension. Additionally, I'm seeing:

Cannot load underlying module for 'Alamofire

Environment

  1. Xcode version: 16.2
  2. macOS version: Sonoma 14.7
  3. Swift version: 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
  4. Dependency management: CocoaPods
  5. Alamofire version: 5.8

My project is a large, older codebase that contains a mix of UIKit, Objective-C and Swift

Architecture Issue: The project only builds successfully in Rosetta mode for simulators. SwiftUI previews are failing in both Rosetta and native arm64 environments. This suggests there may be a fundamental issue with how the preview system interacts with the project's architecture configuration. What I've Tried I've attempted several solutions without success:

  1. Cleaning the build folder (⇧⌘K and Option+⇧⌘K)
  2. Deleting derived data
  3. Reinstalling dependencies
  4. Restarting Xcode
  5. Removing and re-adding Alamofire

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论