Questions tagged [swift-package]

103 questions
1
vote
0 answers

Building static library with Swift package

I tried to build static library this way: swift build -c release -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphoneos --show-sdk-path`" -Xswiftc "-target" -Xswiftc "arm64-apple-ios14.0" But I can't import any classes from the .a file after linking it to…
badadin
  • 507
  • 1
  • 5
  • 18
1
vote
2 answers

Swift Package Dependency: "No Such Module..." - Why?

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…
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
1
vote
0 answers

How do you change build settings in a Swift Library?

I know how to access and change the build settings in a Swift app. However, when I try to do the same in a Swift library, there's nothing there. Clicking on the library name at the top of the file navigator just opens the Package.swift file, and…
Bbrk24
  • 739
  • 6
  • 22
0
votes
0 answers

How should I handle my Firebase dependency if Xcode recognizes "import Firebase", but doesn't recognize anything else? (SPM)

I'm using XCode 14.2, and Swift Package Manager. I've imported Firebase version 10.14.0, with libaries FirebaseAnalytics and FireFirestore. However, XCode, does not recognizes statements such as FirebaseApp.configure(), and throws errors even when…
0
votes
0 answers

Install a SDK remotely without bundling into the app

We have the Native iOS and Android apps which are already considerably larger in size. Planning to integrate a new SDK into the app which would increase the app size considerably (> 200mb). To mitigate this, on Android we are using Android Expansion…
Rahul Kalidindi
  • 4,666
  • 14
  • 56
  • 92
0
votes
0 answers

How do I exclude SwiftUI Previews from code coverage in Swift packages?

I have found solutions explaining how to exclude code coverage for SwiftUI projects, but I have failed to find anything for SwiftUI Packages. My Swift package includes views (and previews) for use in other projects. But my coverage is badly skewed…
0
votes
2 answers

How to debug and build a swift package from a project and why public classes inside the package are still not seen?

I have created a swift package that compiled fine. I have imported the swift package in a project. No class inside the package is seen on the project. So I made them public. I added public init() {} where needed. Methods are still not seen. So I…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
0 answers

Is that possible to create multi-platform Swift Package with storyboards for different platforms?

If I was creating a multi-platform code that includes storyboards for iOS and macOS, for example, I would mark each storyboard to its respective platform, the iOS storyboard to the iOS target and the Mac storyboard to the mac platform. So I have…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
0 answers

Can framework include another framework as a dependency?

I am building a new UI framework, let's call it a framework2, there is already existing UI framework framework1, unfortunately can not add or make more changes to that framework1(Provide by a vendor, and we can't have source code access of it.),…
Vishwa
  • 11
  • 2
0
votes
0 answers

Is it possible to add binary dependency into a framework, and then distribute that framework as a binary dependency(Swift Package)?

I am trying to create two frameworks, framework1 and framework 2. framework 2 has dependency on framework1, and eventually framework 2 will be the final framework used by diff applications, also framework2(XCFramework2) will be distributed through…
0
votes
1 answer

how I can make xcode access my table in my API through a swiftPackage?

I have a database (PostgreSQL) with data, I've create an API (apinetopark) (with vapor) and an app netopark(macOS,swiftUI). My API successfully (localhost) reach the database and return my data. So I tried to create an Swiftpackage…
0
votes
0 answers

Can a Swift Package import a executableTarget?

When I call the main() function of the imported executableTarget, there are errors: Undefined symbol: Linker command failed with exit code 1 (use -v to see invocation) Is that impossible for a executable target depends on another executable target…
zgjie
  • 2,099
  • 2
  • 21
  • 32
0
votes
0 answers

Error in Swift Package: Could not find module 'XXXX' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator,

There is issue with Swift package manager i added and it is showing error Could not find module 'XXX' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator, It is working with Rosetta in Simulator and in actual device with…
IOSDev
  • 205
  • 2
  • 10
0
votes
1 answer

Error message: "Type 'any ViewModifier' cannot conform to 'ViewModifier'"

At the moment I try to create a package with SwiftUI. I created a ProfileImageView. I get an Url as an optional String, which I convert to a non-optional String with if...let... In the body I use this String for an AsyncImage. The AsyncImage just…
0
votes
0 answers

Can not import dependency of Google-Mobile-Ad in my swift package

I want to make a package of google-mobile-ads to use on multiple devices.But the issue is I can not import or add the dependency of google-mobile-ads in my swift package. How I can do this?
Dipon
  • 21
  • 3