Search results for

missing package product

50,396 results found

Post

Replies

Boosts

Views

Activity

Unable to create a simple installable package
Hi, I am a newcomer in macOS development, and I am struggling to create a package with the XCode command line tools that is installable on other computers. In its minimal version, the package shall install a simple program to usr/local/: hello.c: #include int main(void) { printf(Hello Worldn); return 0; } distribution.plist: Hello World h1.pkg build.sh: #!/bin/sh cc -o hello hello.c mkdir -p local/bin cp hello local/bin/ codesign -s - -i net.world.hello local/bin/hello pkgbuild --identifier net.world.hello --root local --install-location /usr/local h1.pkg productbuild --distribution distribution.plist --resources . hello.pkg The build scrips produces a package hello.pkg. However, when I try to install it, I get : Product archive /Users/foo/hello.pkg trustLevel=100 : PKInstallRequest: failed to initialize. Error: Error Domain=PKInstallRequestErrorDomain Code=2 Specifier Description:: { URL = file:///Users/foo/h1.pkg; identifier = net.wo
2
0
875
Mar ’24
Issue with using Swift package with xcframework binaryTarget
Hi! I'm trying to create a target application that depends on multiple targets that all use the same Swift package that has xcframework binaryTarget. Each component can be successfully assembled individually, but when I try to create a core application that depends on these components, I get an error message on Prepare build stage: Multiple commands produce '/Users//Library/Developer/Xcode/DerivedData//Build/Products/Debug/Frameworks/.framework/Versions/A' Target '' has copy command from '/Users//Library/Developer/Xcode/DerivedData//SourcePackages/artifacts/...//.xcframework/macos-arm64_x86_64/.framework' to '/Users//Library/Developer/Xcode/DerivedData//Build/Products/Debug/Frameworks/.framework' Target '' has copy command from '/Users//Library/Developer/Xcode/DerivedData//SourcePackages/artifacts/...//.xcframework/macos-arm64_x86_64/.framework' to '/Users//Library/Developer/Xcode/DerivedData//Build/Products/Debug/Frameworks/.framework' – where is a name of the xcframework
0
0
375
Nov ’24
String catalogs in packages
We have separated much of our UI into different packages to reduce complexity and compile time. When we recently tested using new .xcstrings string catalogs, we hit an unexpected problem. Strings extracted from SwiftUI components like Text or Button are extracted into the Localizable.xcstrings in the same package, but the default behaviour of Text(_ key:tableName:bundle:comment:) is to use Bundle.main. When the default behaviour of the string extraction isn't to extract to the main app target, this introduces a very fragile system where it's easy to add code that looks localised, but ends up failing lookup at runtime. I don't feel comfortable that we will always remember to define the correct module every time we create a Text. Also, other components like Button doesn't have an init that takes a Bundle, so we would also have to remember that Button(_ titleKey:action:) can now only be used in a package if we make sure that the main bundle contains a matching key. Is there a way for u
4
0
2.2k
Sep ’23
Terminal command for XCode->File->Packages->Reset Package Cache
I am using XCode 13.1 and wondering a way to execute XCode->File->Packages->Reset Package Cache on terminal. I see my CI machine is failing every time not for specific package but some random package. And when manually do XCode->File->Packages->Reset Package Cache, it resolves the package graph properly. I already tried clearing DerivedData and also clearing /Users/bostonsamddv/Library/Caches/org.swift.swiftpm with no luck :( Any help will be appreciated.
1
0
2.5k
Oct ’21
Missing ModuleMap with Docbuild
When performing xcodebuild docbuild I'm getting an error that I'm missing a module map for one of my Swift Packages I've included in the project. This is because I want to build the docbuild for iOS only, but have the Swift Package as a macOS only import fatal error: module map file '/Users/administrator/Library/Developer/Xcode/DerivedData/AppName/Build/Intermediates.noindex/Build/Intermediates.noindex/GeneratedModuleMaps-iphoneos/SQLite.modulemap' not found The docbuild is as follows xcodebuild docbuild -scheme XXX -derivedDataPath ${DD_LOCATION} -configuration Release -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES BUILD_DIR=${WORKSPACE}/build DEVELOPMENT_TEAM=XXX The Swift package mentioned is added as macOS only with an optional linkage and I have excluded the paths from source files which makes me able to run the app via xcode. Is there anything else I should be doing to exclude this from being added to the iOS side of our project? Thanks in a
1
0
1.7k
Feb ’24
Building XCFrameworks from a hierarchy of Swift Packages
This post is meant to provide useful information on how to build a set of xcframeworks from a hierarchy of Swift Packages containing a mix of ObjC and Swift. If you only want to build a single xcframework from a Swift Package, as this is not obvious either, you should find some useful info too. Stuff that needs to be done for building an XCFramework from a Swift Package through xcodebuild set library type to .dynamic in Package.swift set SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface in xcodebuild command no need to use 'archive' xcodebuild command, xcodebuild alone is enough In generated framework : copy public headers (in case of ObjC package) copy (or create) module.modulemap file, or copy .swiftmodule file copy umbrella header FooPackage-Swift.h from derived data (use -derivedDataPath xcodebuild option to retrieve it) in case of Swift Package, otherwise won't be useable from ObjC copy resource bundle (if
3
0
3.4k
Nov ’23
Consumable Product Refund Abuse
Hello, We are a mobile game company, We have encountered an issue concerning the refunds of consumable products purchased through our app. The issue arises when some Apple users request refunds after purchasing these products, and Apple approves these refund requests even if our users have already consumed it. This situation leads to financial losses and creates an unfair experience among users. We are using App Store Server Notifications V2. So how can we prevent Refunding if user used already our product
3
0
1.5k
Mar ’24
Reply to Lock icon not visible in .pkg installer
My apologies, I didn't notice that packagesbuild was a third-party tool, I took over the project from a different developer, so I'm not a 100% familiar with the tooling yet. I had a look at the link you sent and managed to get it working by running the productbuild command on the .pkg file generated by packagesbuild. productbuild --sign Developer ID Installer: [...] --package com.optimidoc.cloudclientsigned.pkg com.optimidoc.cloudclient.distribution.pkg I suspect that the problem was in the fact that packagesbuild generates a component package (similar to pkgbuild) rather than a product archive like productbuild does, but I haven't done any testing to verify it. Thank you for pointing me in the right direction.
Topic: Code Signing SubTopic: General
Jun ’24
Can Swift Packages be optional?
I work with a number of enterprise clients and one thing we often do is have various frameworks that are optional depending on what type of build we are doing. A common example being to include a framework that contains an embedded server for testing, demo or debugging purposes. Prior to SPM we would link those frameworks as Optional and run a script phase after the build that removed them from the Frameworks directory of the app if it was a Release build. Now I have an Xcode project that includes a number of SPM package, one of which is an embedded server which in turns references several other packages I'd like to exclude form a Release build. But I cannot figure out how to do this. Can I make the inclusion of a package optional? Or somehow remove it after linking? In Swift I can write #if canImport(MockServer) but I cannot see how to actually make MockServer an optional include. Any ideas?
0
0
928
Jul ’22
SwiftData model in Swift package
Hi, I am looking for information on how to setup a ModelContainer for a Swift app when the SwiftData model is located in a Swift package. Let's say the model code resides in a package called DomainModel. That package was added target's embedded content and the model types are used to init the model container using the modelContainer(for:) view modifier on the ContentView of the app. This crashes the app on startup with a EXC_BAD_ACCESS code=2. When copying the model code from the package directly into the app, the app starts just fine. I kindly ask for a code sample or any information about how to setup the model container when using a model from a Swift package. Thanks in advance and I am looking forward to replacing CoreData 🙂
6
0
2.4k
Jun ’23
Error Missing required module 'RxCocoaRuntime' in xcframeworks
Hi. I have a xcframework that has a dependency on 'RxSwift' and 'RxCocoa'. I deployed it using SPM by embedding it in a Swift Package. However when I import swift package into another project, I keep getting the following error: Missing required module 'RxCocoaRuntime How can I fix this? Below are the steps to reproduce the error. Steps Create Xcode proejct, make a dependency on 'RxSwift' and 'RxCocoa' (no matter doing it through tuist or cocoapods) Create XCFramework from that proejct. (I used commands below) xcodebuild archive -workspace SimpleFramework.xcworkspace -scheme SimpleFramework -destination generic/platform=iOS -archivePath ./SimpleFramework-iphoneos.xcarchive -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES xcodebuild archive -workspace SimpleFramework.xcworkspace -scheme SimpleFramework -archivePath ./SimpleFramework-iphonesimulator.xcarchive -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES xcodebuild -create-xcframe
0
0
185
Mar ’25
Reply to SwiftUI Preview Runtime linking failure
Thank you for bearing with me! This was key missing information. I can reproduce the problem in a small sample project using a package structure like you described here. I'll update the feedback and see what we can do with the build system and linker teams to figure this out.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’25