Reputation: 9493
Goal: To learn how to add an import to a Swift package.
Modus Operandi: Use an Apple-supplied Example as base. Add another import (i.e., Alamofire)
Result: Alamofire does import; but its module "can't be found".
The Package:
The Sources:
Question:
Why is this happening?
What am I missing?
Upvotes: 4
Views: 1344
Reputation: 368
Inside the .target
section in your targets
section in package.swift
file, add your dependencies as like array objects 👇🏻
.target(
name: "DeckOfPlayingCards",
dependencies: ["PlayingCard", "Alamofire"]),
This solved my problem. I was also having the same issue showing No such module "Alamofire".
Not only Alamofire but also every other. I forgot to put my dependencies there.
I hope this will help someone sometime.
Upvotes: 0
Reputation: 568
Check the target DeckOfPlayingCards
, select the General
tab, check Framework, Libraries, and Embedded Contents
, make sure Alamofire
is on the list
Upvotes: 5