Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

186
Visualizações
Module not found using Swift Package Manager building app target

I'm using Swift Package Manager to modularize a large mixed Objective-C and Swift iOS app. The app also uses CocoaPods for a few dependencies for which there is no Swift Package.

My project structure is as follows:

ios/
  MyApp/
    ...
    CorePackage/
       Sources/
          Core/ ...Swift stuff goes here
          CoreObjC/ ... Obj-C stuff goes here

I have created the following Package.swift for my CorePackage. Note that I'm trying to use a Swift Language Swift Package in an Objective-C Language Swift Package:

let package = Package(
    name: "CorePackage",
    products: [
        .library(name: "Core", targets: ["Core", "CoreObjC"]),
    ],
    dependencies: [ ... ],
    targets: [
        .target(
            name: "Core",
            dependencies: [ ... ],
            path: "Sources/Core"
        ),
        .target(
            name: "CoreObjC",
            dependencies: [ "Core", ... ],
            path: "Sources/CoreObjC",
            publicHeadersPath: "include"
        )
    ]
)

The following build command succeeds when run in the MyApp/CorePackage directory:

> xcodebuild -scheme "Core" -sdk iphonesimulator  -destination 'platform=iOS Simulator,name=iPhone 13' build

I have added the "Core" package to my Frameworks, Libraries and Embedded Content target General Settings.

Now, when I try to build the app target from the ios directory:

> xcodebuild -scheme "MyApp" -sdk iphonesimulator  -destination 'platform=iOS Simulator,name=iPhone 13' -workspace MyApp.xcworkspace build

I get the following error:

/.../ios/MyApp/CorePackage/Sources/CoreObjC/include/HeaderA.h:13:9: error: module 'Core' not found
@import Core;

...

/.../ios/MyApp/HeaderB.h:11:9: note: while building module 'CoreObjC' imported from /.../ios/MyApp/HeaderB.h:11:
@import CoreObjC;

I have had no trouble when using packages with a single target, either Objective-C or Swift. Does anyone know what I'm missing here? So far I've lost a whole day trying to figure it out.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda