I've got an app where I want to split its Model code into a framework (.xcframework and .framework for debugging) so that it can be used by more than one app.
The code has dependencies on 3rd party code, which are installed via pods.
During the conversion process I keep running into the same issue which manifests with all the 3rd party code - which is that the majority of its api can be used (something like 80-90%) but for the remainder there is a linker error at runtime showing undefined symbols.
I have this problem with CocoaLumberjack,RealmSwift, PhoneNumberKit and more.
Its very quick and easy to reproduce the issue with a minimal framework and minimal app, below I'll describe how a minimal setup using CocoaLumberjack reproduces the issue:
From scratch, I use Xcode to create a framework project, run pod init, then modify the pod file to be:
platform :ios, '16.0'
workspace 'TheFramework'
project 'TheFramework'
target 'TheFramework' do
use_frameworks!
pod 'CocoaLumberjack/Swift', '3.8.5'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
Then I add source code:
import Foundation
import CocoaLumberjack
public class AClassInTheFramework {
public class func aMethod() {
let consoleLogger = DDOSLogger.sharedInstance
DDLog.add(consoleLogger, with: .debug)
DDLogDebug("Some logging")
}
}
Within the Xcode project, Build Libraries for Distribution is set to Yes, I also add that line to the pod file in case CocoaLumberjack isn't set similarly.
In the Framework's Xcode General section, Frameworks and Libraries contains Pods_TheFramework.framework set to Do Not Embed.
In the Build Phases section, in the Link Binary with Libraries section, Pods_TheFramework.framework is set to required.
Next I create an Xcode app template, run pod install, and edit the app pod file to be:
platform :ios, '16.0'
workspace 'AppUsingFramework'
project 'AppUsingFramework'
target 'AppUsingFramework' do
use_frameworks!
pod 'CocoaLumberjack/Swift', '3.8.5'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
end
end
I build the framework, and drag and drop it into the app.
I add the following code to the app's delegate:
import TheFramework
...
AClassInTheFramework.aMethod()
The App's target has the following linkage settings:
When I build and run the app, there is the following error:
If I change the source code in the framework to this:
public class AClassInTheFramework {
public class func aMethod() {
let consoleLogger = DDOSLogger.sharedInstance
DDLog.add(consoleLogger, with: .debug)
// DDLogDebug("Some logging")
}
}
Then there is no error and the code runs successfully. This illustrates the problem I've encountered with all the nested frameworks - in this particular case calls to DDLog.add() don't result in an error but calls to DDlogDebug() do, and that has been mirrored with other nested frameworks (for example with Realm, opening a database, adding, finding,retrieving an item all works without a problem, however attempting to use Realm's Results<> API results in a similar symbol not found error).
Additionally note that the identical CocoaLumberjack code can run fine when used directly from within the app, i.e., if I add the following code to the app:
import CocoaLumberjack
func useCocoaLumberjackDirectlyFromWithinApp() {
let consoleLogger = DDOSLogger.sharedInstance
DDLog.add(consoleLogger, with: .debug)
DDLogDebug("Some logging")
}
useCocoaLumberjackDirectlyFromWithinApp()
Then it runs, i.e. DDLogDebug() can be successfully called from within the app, its only when its called via the framework that the error occurs.
Why might I be encountering these issues? I'd have thought either I'd be able to use 100% of the nested framework's public api, or 0% of it (is something is not configured correct), not ~80% which is what I am encountering.
Any ideas?
TIA
Dive into the vast array of tools, services, and support available to developers.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
My project is using Fastlane 2.226.0. After converted groups to folders on XCode 16, I got an error when executed below function in Fastfile:
get_version_number(xcodeproj: "MyProject.xcodeproj", target: "MyProject")
Below is the error message output after I ran fastlane:
Unable to find XCode build setting: MARKETING_VERSION
I'm trying to add an Enterprise Apple account with the username and password of my developer account, which has worked once before. Now its giving me the following error:
"There was an error while trying to log in: No trusted devices or trusted phone numbers are configured for this account."
which doesn't make sense because the 2-Factor Auth works when I login to the website.
What am I missing? I think the only thing different is I'm using a different Macbook, but should that make a difference?
Has anyone else had this error from Visual Studio?
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
Tags:
Enterprise
Developer Tools
My application is in flightTest mode.
I received my first two crash reports in XCODE /Organizer. The context is well described, and I was able to isolate the locations where very serious errors occurred.
My application is connected. I'm missing one piece of data in this crash report: the time of the crash.
This will help me see what (in my case) static data was being read on the data server at that time. This will help me investigate.
Is it possible to obtain this information?
I've discovered what appears to be a system-level memory leak when pressing any key in Swift UI projects. This issue occurs even in a completely empty SwiftUI project with no custom code or event handlers.
When monitoring with Instruments' Leaks tool, I observe multiple memory leaks each time any key is pressed. These leaks consist primarily of:
NSExtraData objects (240 bytes each)
NSMenuItem objects (112 bytes each)
Other AppKit and Foundation objects
Has anyone else encountered this issue? How can I fix this behavior? While the leaks are small (about 5-6KB per keypress), they could potentially accumulate in applications where keyboard input is frequent.
The app I'm working on has iOS 16.0 as target. Recently Live Activities support was added, but then it started crashing when running on iOS 16.0 devices.
After some investigation, I've found that the culprit was the presence of NSUserActivityTypeLiveActivity and WidgetCenter.UserInfoKey.activityID, even though they were inside an @available(iOS 17.2, *) block. If I comment these two variables, the app work as expected. I've also tried adding #if canImport(ActivityKit) around the code, but without success.
But if the @available isn't working, how can I prevent this? It looks like a bug, since the documentation says that NSUserActivityTypeLiveActivity is supported but iOS 14.0+, but I'm pretty sure it was introduced on 16.1.
This is the only output I get with the crash:
dyld[66888]: Symbol not found: _$s9WidgetKit0A6CenterC11UserInfoKeyV10activityIDSSvgZ
Referenced from: <D6EFF120-2681-34C1-B261-8F3F7B388238> /Users/<redacted>/Library/Developer/CoreSimulator/Devices/8B5B4DC9-3D54-4C91-8C88-E705E851CA0F/data/Containers/Bundle/Application/DB6671FF-CB07-4570-BD63-C851D94FAF29/<redacted>.app/<redacted>.debug.dylib
Expected in: <C5E72BB5-533F-3658-A987-E849888F4DFC> /Library/Developer/CoreSimulator/Volumes/iOS_20A360/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 16.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WidgetKit.framework/WidgetKit
I implemented the cloudkit function, where users can connect with each other. The problem is, that if User A is doing a friend request and User B is accepting the request. The friend entry is correct visible for User B but not for User A. I can see in cloud kit that after the accepted request, the friend connection is set up correctly, also with the correct userID, but it not showing up for User A (the one that send the request)
It's in the public database. In this view you sign in using Apple Sign-In and create a specific user ID. Then you can access a global leaderboard to compare with all signed-in users. Additionaly, there’s a friend tab where you can search for and type in a specific user ID. The target user sees the friend request, can accept it, and then the accepted friend appears in their friend list. However, the original requester doesn’t see the connection after acceptance even though CloudKit shows the records Add comment. I've also tried to add a placeholder in for User A, that e.g he send the request and then has a placeholder where it says e.g pending request to User B. After User B accepted the request, the placeholder will go away and no friend connection is displayed, very strange.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
CloudKit
Social
CloudKit Dashboard
CloudKit Console
I have been using Xcode 16.2 for a long time. I downloaded it from the developer site. I recently downloaded Xcode 16.3. I was offline on an airplane and I got an error authenticating my account. Since then, I have not been able to sign my apps. I was able to create a new app that worked but in my effort to resolve the problem, I deleted my account and now I cannot add it back. I was getting a "bad URL" error. Now I'm getting "Could not connect to the server." I sent an email to Apple Dev Support and they told me to download Xcode from the App Store. I did that and it gave me the same error. Is anyone else having this problem? If Apple Dev Support cannot resolve it, I don't know how I am going to.
Topic:
Developer Tools & Services
SubTopic:
Xcode
If I install RealmSwift into an ios app using SPM, I have no problems.
However if I install it into an ios framework, then when building there is this error:
error: missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'
I have discovered that if I change the import statement from:
import RealmSwift
to
private import RealmSwift
then doing that makes this build error goes away (but doing that isn't a feasible workaround as I would like to publicly export classes stored in Realm from the framework).
There's no point in posting issues with Realm on their support board as its being deprecated and its tumble weeds on their forum.
But I would be very interested in hearing from the Apple expects explanation or speculation on:
why is importing the same framework via SPM into a framework xcode project resulting in different behavior then when importing it into an app?
why would changing import to private import make the build error go away?
TIA
I'm trying to rewrite an old AppleScript mail rule that I used extensively as a Mail extension using the MailKit framework and I've run into an issue.
Previously, when developing the script, it was possible to debug it by selecting the message I wanted it applied to and choosing the Mail.app menu item "Message/Apply Rules"
This would re-execute my script and I could iterate over it as many times as I liked while developing.
I haven't found any great way of doing this for my extension with a MEMessageActionHandler. The closest I've found is to forward the message to myself and wait for it to come back in again over the internet, at which point the extension would get executed again. Needless to say, this makes debugging my MEMessageAction handler much slower.
I've tried a number of things in Mail.app to try and get it to re-execute my extension with a particular message without any luck. Does anyone know of a good process for debugging a MEMessageActionHandler that doesn't involve forwarding the message to myself over and over and waiting for it to come in each time?
Topic:
Developer Tools & Services
SubTopic:
General
If you have two video segments, one HDR and one SDR, next to one another in a composition, the SDR one appears dark, since its max luminance will be lower than the max luminance of the HDR clip. iMovie handles this well by (reverse) tone mapping the SDR content to make it look HDR in an HDR composition. This is what I want to achieve.
I've looked into algorithms to do this, and the best that I can find is the conversion from RGB to YCbCr described in Table 4 of BT.2020, followed by conversion method A (Section 4.2, table 4) of BT.2446-1. I have these implemented in a Core Image kernel, available at this repo. The issue that I'm seeing is that the colors are still much too hot, and while there are frames that appear close to properly tone mapped, it doesn't come close to the accuracy of iMovie's approach.
If someone is an expert in colorimetry, etc., I'd really appreciate a breakdown of what I'm doing wrong here. To be specific:
Assuming non-constant luminance for the YCbCr conversion
Using a Metal Core Image kernel for the actual tone mapping
The video composition uses Core Image filters directly
The video composition is using BT.2020 colorimetry and the PQ transfer function.
Below is a comparison of two screenshots, one using an unaltered HDR asset, and the other using the same asset transcoded to SDR with QuickTime, and reverse tone mapped to HDR for playback. Is there something I'm missing?
Thanks for your engagement, participation, and contributions to the Apple Developer Community!
We’ve made some minor updates today to the Forums - curious about what’s changed? Here’s the rundown:
Customize your experience with a developer profile
Creating a developer profile allows you, if you choose, to share your interests and preferences so we’re better able to support you.
In Developer Forums, creating a profile and choosing to share it publicly is an easy way to connect with fellow developers. Soon, having a profile will help unlock a more personalized experience across developer.apple.com - powering smarter surfacing of recommendations, activities, and opportunities tailored to your interests.
Learn more.
Other features and improvements
With this release, we’ve also made some enhancements and fixed a few bugs based on feedback you’ve submitted. These include:
Expanded save draft functionality from posts to replies so you don’t lose those drafts unexpectedly
Added line numbers in code blocks
Restored text highlighting back to system default
Syntax coloring carries through to code blocks within posts
Fixed a time stamping issue which was impacting ‘last updated’ sort functionality
Wish there was a feature or improvement on Developer Forums?
We welcome feedback and feature requests.
Topic:
Developer Tools & Services
SubTopic:
Developer Forums
I just received this crash report of my Application.
It has zero symbol of my App (other crash reports have), so it is very difficult to understand and what meens this mention of:
UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:
>
Date/Time: 2025-03-19 21:39:54.5577 +0100
Launch Time: 2025-03-19 21:31:29.5543 +0100
OS Version: iPhone OS 18.3.2 (22D82)
Release Type: User
Baseband Version: 1.40.03
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x00001c7d7b153b10
Exception Codes: 0x0000000000000001, 0x00001c7d7b153b10
VM Region Info: 0x1c7d7b153b10 is not in any region. Bytes after previous region: 30844223027985
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
owned unmapped memory unmapped-unmapped [ 2064K] rw-/rw- SM=PRV owned physical footprint (unmapped)
--->
UNUSED SPACE AT END
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [1844]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000181a77c20 objc_msgSend + 32 (:-1)
1 UIKitCore 0x0000000187e7c4c8 -[UIApplication _terminateWithStatus:] + 136 (UIApplication.m:7539)
2 UIKitCore 0x0000000186ed5644 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 112 (_UISceneLifecycleMultiplexer.m:819)
3 UIKitCore 0x0000000187626e8c -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 164 (_UISceneLifecycleMultiplexer.m:482)
4 UIKitCore 0x0000000187e77c28 -[UIApplication workspaceShouldExit:withTransitionContext:] + 164 (UIApplication.m:4238)
5 FrontBoardServices 0x000000019e08fcd4 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke_2 + 72 (FBSWorkspaceScenesClient.m:632)
6 FrontBoardServices 0x000000019e0584c8 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168 (FBSWorkspace.m:445)
7 FrontBoardServices 0x000000019e08fc74 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke + 128 (FBSWorkspaceScenesClient.m:629)
8 libdispatch.dylib 0x000000018c2befa8 _dispatch_client_callout + 20 (object.m:576)
9 libdispatch.dylib 0x000000018c2c29f0 _dispatch_block_invoke_direct + 284 (queue.c:515)
10 FrontBoardServices 0x000000019e051378 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:285)
11 FrontBoardServices 0x000000019e0512f8 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 240 (FBSSerialQueue.m:309)
12 FrontBoardServices 0x000000019e0511d0 -[FBSMainRunLoopSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:322)
13 CoreFoundation 0x0000000184570f4c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1970)
14 CoreFoundation 0x0000000184570ee0 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2014)
15 CoreFoundation 0x0000000184573b40 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2051)
16 CoreFoundation 0x0000000184572d3c __CFRunLoopRun + 840 (CFRunLoop.c:2969)
17 CoreFoundation 0x00000001845c5284 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434)
18 GraphicsServices 0x00000001d18354c0 GSEventRunModal + 164 (GSEvent.c:2196)
19 UIKitCore 0x000000018710e674 -[UIApplication _run] + 816 (UIApplication.m:3846)
20 UIKitCore 0x0000000186d34e88 UIApplicationMain + 340 (UIApplication.m:5503)
21 UIKitCore 0x000000018747115c UIApplicationMain(_:_:_:_:) + 104 (UIKit.swift:565)
22 maPollution 0x000000010405c240 specialized static UIApplicationDelegate.main() + 28 (/<compiler-generated>:20)
23 maPollution 0x000000010405c240 static AppDelegate.$main() + 28 (AppDelegate.swift:0)
24 maPollution 0x000000010405c240 main + 116
25 dyld 0x00000001aa821de8 start + 2724 (dyldMain.cpp:1338)
Thread 1 name:
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hello guys,
I have probleme with the lib react tinode on ios , someone can help m on it plz ?
I posted a question 7 days ago and now it looks like I can't edit or delete it.
Swift Package:
I have an old objc library, that is added as XCFramework to swift package as a binary target.
targets: [
.target(
name: "CoreServices",
dependencies: ["OldContainer"],
path: "CoreServices"
),
.binaryTarget(
name: "OldContainer",
path: "Frameworks/OldContainer.xcframework"
),
]
This serves the purpose, it builds fine and able to run on simulator. However this framework is breaking the Xcode previews.
Error:
== PREVIEW UPDATE ERROR:
[Remote] JITError: Runtime linking failure
Additional Link Time Errors:
Symbols not found: [ _OBJC_CLASS_$_SCSecureServicesFactory ]
==================================
| [Remote] LLVMError
|
| LLVMError: LLVMError(description: "Failed to materialize symbols: { (static-Login, { __replacement_tag$1015 }) }")
== VERSION INFO:
Tools: 16C5032a
OS: 23G93
PID: 38675
Model: MacBook Pro
Arch: arm64e
== ENVIRONMENT:
openFiles = [
/Users/../Documents/GitHub/Packages/Login/Sources/Login/LoginView.swift
]
wantsNewBuildSystem = true
newBuildSystemAvailable = true
activeScheme = Launch
activeRunDestination = iPhone 16 Pro Max variant iphonesimulator arm64
workspaceArena = [x]
buildArena = [x]
buildableEntries = [
Login
Login
]
runMode = JIT Executor
== SELECTED RUN DESTINATION:
Simulator - iOS 18.2 | iphonesimulator | arm64 | iPhone 16 Pro Max | no proxy
== EXECUTION MODE OVERRIDES:
Workspace JIT mode user setting: true
Falling back to Dynamic Replacement: false
Based on the error, SCSecureServicesFactory is an objc file inside the XCFramework. Since this is a binary target, I could not add a swift setting module map flag to the XCFramework.
Is there any workaround to get the previews working ? Or Am I blocked until the library is converted into swift ?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Swift Packages
Developer Tools
Xcode Previews
I cannot believe how slow, opaque, and frustrating the Apple Developer enrollment process has become. I have been waiting for over a month, and every single step has been a nightmare.
I have paid twice, the latest over a week ago, and still no activation.
I have sent over 10 emails to support, and either I get no response or the same useless generic reply that does nothing to resolve the issue.
I post here on the forum, and Apple remains completely silent.
How can a company like Apple treat its developer partners this way? Google and Meta finalize these processes in 48 hours, while here, every step feels like a black hole of delays and excuses.
This situation is beyond unacceptable. If Apple wants serious developers on its platform, it needs to fix this broken system.
Has anyone else been stuck in this endless loop? What solutions exist, other than waiting forever?
case (#102554666707)
case [20000095668276]
#AppleFail #DeveloperSupport #Frustrated
Topic:
Developer Tools & Services
SubTopic:
Apple Developer Program
I'm encountering an issue while trying to build my iOS app in Xcode for the simulator.
Issue:
Xcode Version: 15.x
macOS Version: 14.x (Sonoma)
Simulator: iPhone 16 Pro
Error Message: Command ClangStatCache failed with a nonzero exit code
Steps Taken:
Cleaned build folder (Shift + Cmd + K)
Deleted DerivedData (rm -rf ~/Library/Developer/Xcode/DerivedData)
Updated Xcode and checked iOS SDK updates
Disabled Clang Static Analyzer Cache
None of these steps resolved the issue. Any help would be appreciated!
Thanks in advance.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Developer Tools
Xcode Static Analyzer
Simulator
Command Line Tools
Hi everyone,
I’m facing a major roadblock with my family location tracking app, and I need some advice or guidance from the community.
Background
Back in 2021, I implemented NSE filtering entitlement to send location-based notifications and retrieve the device's location in return (as suggested by Apple’s technical code support). Over time, I built my app around this entitlement, adding many features that depend on it.
When Location Push Service Extension was introduced for iOS 15+, I adapted accordingly:
NSE filtering was used for devices below iOS 15
Location Push Service Extension was used for iOS 15+
NSE filtering also played a crucial role in:
✅ Accepting/rejecting location-based notifications
✅ Checking device settings & location permissions (since location push won’t work without proper permissions)
The Issue
In November 2024, I created a new developer account to change my business entity. Since then, I’ve been requesting the NSE entitlement repeatedly for four months, but Apple keeps rejecting it. Meanwhile, they approved the Location Push Entitlement, but without NSE filtering, I’m forced to rewrite a huge part of my app’s core functionality.
I’ve sent multiple emails explaining my use case, but I keep getting rejected without any clear explanation or workaround.
My Ask
Has anyone faced a similar issue with NSE entitlement?
Are there any alternative approaches to achieve the same functionality?
Any advice on how to escalate this to Apple or get proper feedback on why it's being rejected?
I’ve invested years into this app, and a forced rewrite would take months. Any help, insights, or contacts who could assist would be greatly appreciated!
Thanks in advance! 🙏
Topic:
Developer Tools & Services
SubTopic:
Xcode
I have a iOS app using a gobind xcframework library.
All went well when using Xcode 15.0 (15A240d), but failed on Xcode 16.2 (16C5032a). It’s confirmed the failure is from only Xcode version difference, all others like source code, lib binary, physical test iPhone all keeping the exact same.
After digging, the root comes from golang os.Executable() call (https://pkg.go.dev/os#Executable), which is used in xcframework library.
Using Xcode 15.0, os.Executable() returns “/var/containers/Bundle/Application/E80602C7-EFFB-4F1B-9FF8-FBA0E7E3DA76/Runner.app/Runner” as normal.
But with Xcode 16.2, os.Executable() panic with err “cannot find executable path”.
I’ve checked Xcode&SDK version change history, couldn’t find any clue like relevant permissions restrictions stuff.
Could someone please share a hint? Thanks .