Since 2023 Apple have strongly suggested signing XCFrameworks to verify their origins. This has worked perfectly fine for the last year. Seeing that our certificate was about to expire, we revoked it and created a new one which we will use to sign all future releases. However, because that first certificate has been revoked, all previous releases of our XCFramework now have invalid signatures because the certificate they used no longer exists.
While an update to the latest XCFramework would solve the issue, that's not always a possibility for people with lower minimum deployment targets that can only run an older version of our XCFramework. In the wwdc video on the topic it states:
When the xcframework author's signing certificate expires, Xcode is able to automatically validate that a new certificate for Apple Developer Program identities is from the same developer.
Does this mean that if we had not pre-empted the expiry and instead let the certificate expire, we wouldn't have this backwards compatibility issue?
The course of action we've had to take is to manually go through all of our releases for the last year and re-sign them with the latest certificate. This doesn't seem like a tenable solution each year.
Looking for guidance on how to manage this situation each year.
Swift Packages
RSS for tagCreate reusable code, organize it in a lightweight way, and share it across Xcode projects and with other developers using Swift Packages.
Posts under Swift Packages tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I am trying to include custom symbol resources in a swift package for use in other projects. I have read the documentation here:
https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package
However there is no example code and I have created a very simple project to try and get this working but it does not.
.target(
name: "TestLibrary",
resources: [.process("Resources/Media.xcassets")]
),
This is in the Package.swift file and the path relative to the Package.swift file is Sources/TestLibrary/Resources/Media.xcassets.
There's a GitHub project with an example custom SF Symbol SVG (but this may not be available in the future): https://github.com/kudit/TestLibrary
Including this as a package in a blank Swift Playgrounds App project and just importing the TestLibrary and including TestImageView() in the ContentView technically works (it shows the system full star image, but none of the ways of rendering the test symbol as recommended works. It does work for a few of the options in the #Preview when viewing the project in Xcode.
Anyone have any suggestions or know how to get the resources to be accessible from outside the module? I have tried both the .copy( option as well as the .process( option and neither seem to work.
In a new document-based UIKit app, specifying in the Info.plist an import type identifier of public.log that conforms to public.content, public.data, public.item accomplishes this.
In a new document-based SwiftUI multi-platform app, doing the same crashed at the DocumentGroup initializer with the error
_SwiftData_SwiftUI/Documents.swift:91: Fatal error: The document type is public.log which does not conform to com.apple.package.
This initializer expects the document type to be a package.
We use a local swift package in 6 of our app extensions. The product from the local package that we link to each app extension is a dynamic framework. And while the dynamic framework is copied into the final app bundle once, the resource bundles of each target that comprise the dynamic framework is copied into each app extension. I'd much rather have the bundles be copied into the dynamic framework once to prevent app bloat.
Here is a visualization of the issue:
.
└── MyApp.ipa/
├── MyApp (executable)
├── MyDynamicFramework_TargetA.bundle
├── MyDynamicFramework_TargetB.bundle
├── MyDynamicFramework_TargetC.bundle
├── Frameworks/
│ └── MyDynamicFramework.framework/
│ ├── TargetA
│ ├── TargetB
│ └── TargetC
└── PlugIns/
├── Widgets.appex/
│ ├── MyDynamicFramework_TargetA.bundle
│ ├── MyDynamicFramework_TargetB.bundle
│ └── MyDynamicFramework_TargetC.bundle
├── Intents.appex/
│ ├── MyDynamicFramework_TargetA.bundle
│ ├── MyDynamicFramework_TargetB.bundle
│ └── MyDynamicFramework_TargetC.bundle
├── IntentsUI.appex/
│ ├── MyDynamicFramework_TargetA.bundle
│ ├── MyDynamicFramework_TargetB.bundle
│ └── MyDynamicFramework_TargetC.bundle
├── NotificationContent.appex/
│ ├── MyDynamicFramework_TargetA.bundle
│ ├── MyDynamicFramework_TargetB.bundle
│ └── MyDynamicFramework_TargetC.bundle
├── RichPushContent.appex/
│ ├── MyDynamicFramework_TargetA.bundle
│ ├── MyDynamicFramework_TargetB.bundle
│ └── MyDynamicFramework_TargetC.bundle
└── NotificationService.appex/
├── MyDynamicFramework_TargetA.bundle
├── MyDynamicFramework_TargetB.bundle
└── MyDynamicFramework_TargetC.bundle
Notice that the resource bundles of Target A, B, and C are copied multiple times causing an unhealthy app size.
I'd either like the resource bundles to be copied into MyDynamicFramework or copied once into the app bundle and let the app extensions reference them.
Given the SPM + Xcode linking is a black box for the most part, how would I accomplish this?
I am facing issue in changing the initial coordinates of map from (0,0) to any other coordinates, before going to the map screen. So that map will start from the desired coordinates , not from (0,0).
大家好,我正在尝试制作一个关于如何检测手机屏幕前是否有物体的演示。如果有物体,屏幕将显示红色,如果没有物体,则显示绿色。这可能需要调用距离传感器,但我不知道如何调用它。希望大家能给我一个回应。谢谢。
I've complied with the reason declaration following the links sent by the autogenerated emails for the surface level Runner declaration, however libswift has the incorrect values for the reason codes for UserDefaults. I've checked their github and there is no way to add issues since it is "read-only". I'm also in the dark for who to contact regarding this. Does anyone have any idea how to resolve this aside from manually changing the privacy files? I don't want to have to do this each time I do pod install.
ITMS-91055: Invalid API reason declaration - The PrivacyInfo.xcprivacy for the “Frameworks/libswiftObjectiveC.dylib” file contains “DDA9.1” as the value for a NSPrivacyAccessedAPITypeReasons key instead of a valid reason code for using an API in the NSPrivacyAccessedAPICategoryUserDefaults category.
Hello everyone!
I am kind a new here and trying to learn Swift.
I am getting this error "Expressions are not allowed at the top level"
I´ve tried both with an function and without function!
func text(){
let number = 120
print(number.isMultiple(of: 3))
}
text()
Without function
let number = 120
print(number.isMultiple(of: 3))
I really appreaciate if you can help me out!
My playground app is crashing every time I open it so I´ve got no other choice but to use Xcode
Kind regarding
Your noob friend!
I have encountered an issue related to the usage of string catalogs in a Swift package. I created a repository for reproduction.
https://github.com/atacan/DiscussionStringCatalogPackage
The Readme.md file has all the details. Here is a short summary:
The Package.swift file's target has resources: [.process("Resources")], and this Resources folder contains a string catalog. The catalog is correctly populated by the compiler, and German translations are added. Text view is using bundle: .module argument.
However, when the scheme run options are changed to German, the UI still displays English text. Xcode throws a warning indicating that the German translation for the text is not found in the Localizable table of the bundle and it says (not loaded). Although the bundle contains translations in the Localizable.strings file.
Screenshots of the issue are available in the original README file. I am looking for any insights or solutions to this problem.
When distributing a 3rd party SDK as an XCFramework in order to include the privacy manifest to the bundle you need to include the resources key in the target configuration to point to the correct file, for example:
resources: [.process("Resources/PrivacyInfo.xcprivacy")]
However, when distributing the xcframework as a binaryTarget resources is not available. How can I include my privacy manifest when configuring Package.swift ?
Would like to be able to bring up the iOS keyboard in a SwiftUI view without having to use a TextField? The goal would be to capture each keyup, or keydown, using .onKeyPress
While I thought I could create a TextField not visible to the user, was hoping there was a cleaner way.
Hi, I'm facing an issue with triggering sign in. The button only triggers after a long press, not just simple tap. There's no scrollView, just ZStack. I've already tried deleting all the layers and components except this button, still nothing.
There is no Swift Package in Xcode new project templates!!!
Where can I find it!???
Before:
Now:
I am getting the following error after xcode was updated, it is saying that i cant find the googlemobileads framwork, however i have since, restarted my mac, restart xcode, reset simulator, erare all content and settings, delete derivadata, delete the devices and create new one. also check that the framework is being link. see below
Apple i need help here
[!] The Runner [Debug] target overrides the ENABLE_BITCODE build setting defined in `Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig'. This can lead to problems with the CocoaPods installation
How to fix this error ?
So I am running into a very strange issue. Xcode is deleting the Package.resolved file after every build, resulting in having to manually Reset Package caches after every build/run/test.
Extremely annoying, any idea why this is happening?
Hi, im new to swift development and i'm building ios version for my website chatpdf.so and i'm having trouble parsing server sent event from my server to the mobile app. Is there good library for swift to parse sse easily? I'm trying to implement it natively but im getting parsing error in EventSource.
I've a workspace with multiple packages, and due to the a bug in Xcode I cannot export the app localizations using the Xcode GUI tool, but I need to resort on using a command from terminal
xcodebuild -exportLocalizations -localizationPath . -workspace <path_workspace> -sdk iphoneos -exportLanguage en
One of my packages contains some macros, and I use them from my code without any problem, the code compile
But when I try to export localizations using that command, the build fails due to "compiler plugin not loaded"
So I cannot use Xcode normal exporting because Xcode bug, and cannot export by running a command due to the macro problem
What should I do? It is very discouraging this situation, do you have any suggestion?
I've found a similar problem
SwiftUI Previews that work in Xcode 15.2 now fail in Xcode 15.3 with failedToGenerateThunkInfo error
I have a Swift Package Manager module with some SwiftUI files that I was using Previews without issues in Xcode 15.2. When I upgraded to Xcode 15.3, it fails with “Cannot preview in this file. Unexpected error occurred”. When I click to get more info, this is the error:
== PREVIEW UPDATE ERROR:
HumanReadableSwiftError
BuildError: failedToGenerateThunkInfo(could not generate preview info: noTargetBuildGraph)
Is anyone experiencing the same problems? My preview, which lives in a SPM package, works totally fine in Xcode 15.2, but fails in Xcode 15.3. Any ideas for how to fix it? I've tried deleting DerivedData, resetting package caches, clean building.
So frustrating seeing these regression issues popping up still.
I filed FB13678356 but it was quickly marked as "Investigation Complete - Unable to diagnose with current information" but there was no request for what further information I could provide! I attached a full sysdiagnose and error log!
Would also note, that when I revert back to Xcode 15.2, the previews go back to working...
Hey!
I noticed a difference between Xcode 15.2 and 15.3 which causes our production build to fail verification with Apple. This happens with one Swift Package which has xcframeworks as binary targets. There is no issue when exporting the app using Xcode 15.2, as the frameworks are not exported into the Frameworks folder within the app package when inspecting the exported archive. With Xcode 15.3 it is exported which then causes the following error:
2024-03-11 13:53:03.520 *** Error: ERROR: [ContentDelivery.Uploader] Asset validation failed (90208) Invalid Bundle. The bundle App.app/Frameworks/AppCenter.framework does not support the minimum OS Version specified in the Info.plist. (ID: 9e47cf5c-dc23-4cdf-8490-f9befc9e2aa1)
2024-03-11 13:53:03.521 *** Error: ERROR: [ContentDelivery.Uploader] Asset validation failed (90208) Invalid Bundle. The bundle App.app/Frameworks/AppCenterAnalytics.framework does not support the minimum OS Version specified in the Info.plist. (ID: 619289b3-c102-4161-8b63-73d42292a3cf)
2024-03-11 13:53:03.522 *** Error: ERROR: [ContentDelivery.Uploader] Asset validation failed (90208) Invalid Bundle. The bundle App.app/Frameworks/AppCenterCrashes.framework does not support the minimum OS Version specified in the Info.plist. (ID: ac590192-a99b-4aec-ad08-b21afadd10d0)
2024-03-11 13:53:03.522 *** Error: ERROR: [ContentDelivery.Uploader] Asset validation failed (90208) Invalid Bundle. The bundle App.app/Frameworks/AppCenterDistribute.framework does not support the minimum OS Version specified in the Info.plist. (ID: 69e0e8a6-11a7-46e5-9e5a-cf85c8fc15be)
2024-03-11 13:53:21.546 INFO: [ContentDelivery.Uploader]
=============
VERIFY FAILED with 4 errors.
=============
2024-03-11 13:53:21.548 *** Error: Validation failed for 'OEBB.ipa'.
2024-03-11 13:53:21.548 *** Error: Asset validation failed Invalid Bundle. The bundle App.app/Frameworks/AppCenter.framework does not support the minimum OS Version specified in the Info.plist. (ID: 9e47cf5c-dc23-4cdf-8490-f9befc9e2aa1) (90208)
{
NSLocalizedDescription = "Asset validation failed";
NSLocalizedFailureReason = "Invalid Bundle. The bundle App.app/Frameworks/AppCenter.framework does not support the minimum OS Version specified in the Info.plist. (ID: 9e47cf5c-dc23-4cdf-8490-f9befc9e2aa1)";
NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Invalid Bundle. The bundle App.app/Frameworks/AppCenter.framework does not support the minimum OS Version specified in the Info.plist., id=9e47cf5c-dc23-4cdf-8490-f9befc9e2aa1, code=STATE_ERROR.VALIDATION_ERROR.90208, title=Asset validation failed, NSLocalizedFailureReason=Invalid Bundle. The bundle App.app/Frameworks/AppCenter.framework does not support the minimum OS Version specified in the Info.plist., NSLocalizedDescription=Asset validation failed}";
"iris-code" = "STATE_ERROR.VALIDATION_ERROR.90208";
}
2024-03-11 13:53:21.548 *** Error: Asset validation failed Invalid Bundle. The bundle App.app/Frameworks/AppCenterAnalytics.framework does not support the minimum OS Version specified in the Info.plist. (ID: 619289b3-c102-4161-8b63-73d42292a3cf) (90208)
{
NSLocalizedDescription = "Asset validation failed";
NSLocalizedFailureReason = "Invalid Bundle. The bundle App.app/Frameworks/AppCenterAnalytics.framework does not support the minimum OS Version specified in the Info.plist. (ID: 619289b3-c102-4161-8b63-73d42292a3cf)";
NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Invalid Bundle. The bundle App.app/Frameworks/AppCenterAnalytics.framework does not support the minimum OS Version specified in the Info.plist., id=619289b3-c102-4161-8b63-73d42292a3cf, code=STATE_ERROR.VALIDATION_ERROR.90208, title=Asset validation failed, NSLocalizedFailureReason=Invalid Bundle. The bundle App.app/Frameworks/AppCenterAnalytics.framework does not support the minimum OS Version specified in the Info.plist., NSLocalizedDescription=Asset validation failed}";
"iris-code" = "STATE_ERROR.VALIDATION_ERROR.90208";
}
2024-03-11 13:53:21.548 *** Error: Asset validation failed Invalid Bundle. The bundle App.app/Frameworks/AppCenterCrashes.framework does not support the minimum OS Version specified in the Info.plist. (ID: ac590192-a99b-4aec-ad08-b21afadd10d0) (90208)
{
NSLocalizedDescription = "Asset validation failed";
NSLocalizedFailureReason = "Invalid Bundle. The bundle App.app/Frameworks/AppCenterCrashes.framework does not support the minimum OS Version specified in the Info.plist. (ID: ac590192-a99b-4aec-ad08-b21afadd10d0)";
NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Invalid Bundle. The bundle App.app/Frameworks/AppCenterCrashes.framework does not support the minimum OS Version specified in the Info.plist., id=ac590192-a99b-4aec-ad08-b21afadd10d0, code=STATE_ERROR.VALIDATION_ERROR.90208, title=Asset validation failed, NSLocalizedFailureReason=Invalid Bundle. The bundle App.app/Frameworks/AppCenterCrashes.framework does not support the minimum OS Version specified in the Info.plist., NSLocalizedDescription=Asset validation failed}";
"iris-code" = "STATE_ERROR.VALIDATION_ERROR.90208";
}
2024-03-11 13:53:21.548 *** Error: Asset validation failed Invalid Bundle. The bundle App.app/Frameworks/AppCenterDistribute.framework does not support the minimum OS Version specified in the Info.plist. (ID: 69e0e8a6-11a7-46e5-9e5a-cf85c8fc15be) (90208)
{
NSLocalizedDescription = "Asset validation failed";
NSLocalizedFailureReason = "Invalid Bundle. The bundle App.app/Frameworks/AppCenterDistribute.framework does not support the minimum OS Version specified in the Info.plist. (ID: 69e0e8a6-11a7-46e5-9e5a-cf85c8fc15be)";
NSUnderlyingError = "Error Domain=IrisAPI Code=-19241 \"Asset validation failed\" UserInfo={status=409, detail=Invalid Bundle. The bundle App.app/Frameworks/AppCenterDistribute.framework does not support the minimum OS Version specified in the Info.plist., id=69e0e8a6-11a7-46e5-9e5a-cf85c8fc15be, code=STATE_ERROR.VALIDATION_ERROR.90208, title=Asset validation failed, NSLocalizedFailureReason=Invalid Bundle. The bundle App.app/Frameworks/AppCenterDistribute.framework does not support the minimum OS Version specified in the Info.plist., NSLocalizedDescription=Asset validation failed}";
"iris-code" = "STATE_ERROR.VALIDATION_ERROR.90208";
}
The package used is the following: https://github.com/ilendemli/appcenter-sdk-apple-spm (package by me, using binary packages to avoid building AppCenter every time)
Comparison image: Left exported using Xcode 15.2 (works), right exported using 15.3 (fails)