Dive into the vast array of tools and services available to developers.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

When creating a nested framework, most but not all symbols found
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
2
0
215
Mar ’25
Creating an installer for a V3 AudioUnit
I've got a bunch of AudioUnit projects approaching release, and am attempting to build an installer for them. All are based on the AudioUnit template in Xcode 14. What actually governs how the system detects an AudioUnit? The instructions I have seen say that the built .appex should be renamed to have the extension .component and installed into /Library/Audio/Plug-Ins/Components/ - great, I am able to build a signed installer that does that (i.e. strip out the built Application project that is part of the AudioUnit template but useless to, say, a Logic Pro user), include the .appex that declares the plugin and embeds a Framework that contains the actual code (so it can be loaded in-process). auval -l does not show it after running the installer, nor does Console show anything logged suggesting that it was found but malformed or something like that. Meanwhile, simply building the project causes auval -l to show an install of it in the build directory, and I have noticed that if I delete that, auval -l would still show the plugin installed, but now in the location I exported an archive of the project (!!). What black magic is this? However, deleting both the recent build and the archive, after running the installer, and there is no indication that AudioComponentRegistry even sees the copy of it in one of the two locations actually documented to be valid install locations for an AudioUnit. I have, however, installed one third-party free AUv3 which installed into /Library/Audio/Plug-Ins/Components/ Am I misunderstanding something about how this works? Is there some string other than AudioComponentRegistry I should filter on in Console that might provide a clue why my AudioUnit installed there is not picked up? Must I ship the semi-pointless Application that is part of the Xcode template project, and whatever magical mechanism detects it when I build will work its magic on end-users' machines? Or could the problem be that the Framework with the actual code under Contents/Frameworks inside the audio unit, rather than installed independently into /Library/Frameworks?
2
0
690
Sep ’24
Errors after importing plugins on other machines via source control
We are trying to setup Apple Unity Plugins, in out project we have a handful of developers who contribute to the project via git. When building and importing plugins via tarball (as instructed in the Github repo) the package clearly points to local path, so once pushed all members encounter the error: An error occurred while resolving packages: Project has invalid dependencies: com.apple.unityplugin.accessibility: Tarball package [com.apple.unityplugin.accessibility] cannot be found at path ..... When trying to actually move content to the package folder (same way as any other unity plugins is setup) and add it as "embedded", it works fine on local machine, but team members will get a few of errors: [Apple Unity Plug-ins] No Apple native plug-in libraries found. DLLNotFoundException: AppleCoreNativeMac assembly ... No Apple Native plug-in libraries found. Moreover AppleCoreNativeMac.bundle is flag as not verified and deleted by macOS. What is the right way to setup unity plugins in a project used by multiple members via sourcetree ?
2
0
177
Mar ’25
Swift Compiler Issue?
I've encountered a strange issue with Swift and I wonder if this is a compiler error or if I didn't understand something correctly. The following sample code shows a weird issue (please ignore that the demo code itself would not make that much sense in this form, it's just the version from a big and more complicated project, where this would make more sense): class Test { var data: [String:[String:String]] = [:] func test() { let setValue: ((String, String, String) -> Void) = { [weak self] key, id, value in if self!.data[key] == nil { self!.data[key] = [:] } let oldValue = self!.data[key]![id] if oldValue == nil { self!.data[key]![id] = value } } setValue("0", "1", "2") } } When changing the "data" dictionary through the closure within the "test()" function, everything works as expected until the "if" condition where the oldValue is checked against nil. If I set a break point to this condition, the Xcode debugger tells me that oldValue is nil (which is expected), but the code within the if condition is NOT executed. The comparison oldValue == nil should be be true (because oldValue is actually nil), but the compiler seems to assume something else. But If I do not user "self!" but instead "self?" then it does work as expected and the code within the if condition is executed. What I am missing here? Is this the correct behavior or a compiler bug?
2
0
298
Dec ’24
No KDKs available for macOS 26.0 Developer Beta 2 and later
As of now, there is no Kernel Debug Kit (KDK) available for macOS 26.0 Developer Betas after the first build. Kernel Debug Kits are crucial for understanding panics and other bugs within custom Kernel Extensions. Without the KDK for the corresponding macOS version, tools like kmutil fail to recognize a KDK and certain functions are disabled. Additionally, as far as I am aware, a KDK for one build of macOS isn't able to be used on a differing build. Especially since this is a developer beta, where developers are updating their software to function with the latest versions of macOS, I'd expect a KDK to be available for more than one build.
2
0
284
Jul ’25
Is the new iPadOS/macOS 26 help icon available in SF Symbols?
Under macOS 26 and iPadOS, the Help menu in many cases has a menu item for "App Help". This item has the following icon: I need to use this in my own app. I am unable to find this icon in SF Symbols 7 beta. I've scanned all of the icons under "What's New". I've searched for "help", "light", and "bulb" and this icon does not appear. Does anyone know if it's even a new SF Symbol? Or does anyone know of a way to use this icon?
2
0
133
Jul ’25
Analyzing crash report
Hello, I'm doing an update to my app already IN the app store. The app is built using .Net Maui targeting iOS, Windows and Android. All works fine in debug and in release on Android and Windows. However, the app launches on my iOS devices and crashes immediately. I really have no idea what the crash report on the device is telling me. Attached is the .ips file if anyone can at least point me in the right direction... Thanks MyApp-2025-03-01-202630.ips
2
0
275
Mar ’25
Unable to compile gcc installed from Homebrew
I have command line tools installed: % pkgutil --pkg-info=com.apple.pkg.CLTools_Executables package-id: com.apple.pkg.CLTools_Executables version: 16.2.0.0.1.1733547573 volume: / location: / install-time: 1739567437 Thus clang is installed here: % whereis g++ g++: /usr/bin/g++ I also have installed gcc from homebrew: % /opt/homebrew/bin/g++-14 --version g++-14 (Homebrew GCC 14.2.0_1) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. However, I still cannot compile any c++ code, even the simplest one: #include &lt;iostream&gt; using namespace std; int main() { cout &lt;&lt; "Hello World!" &lt;&lt; endl; return 0; } It returned this error: % /opt/homebrew/bin/g++-14 ~/Downloads/try.cpp ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk/usr/lib/libSystem.tbd' for architecture arm64 collect2: error: ld returned 1 exit status It seems to be command line tools related. But I've already installed the most recent version of CLT and gcc. Additionally, clang can compile the same code: % /usr/bin/g++ ~/Downloads/try.cpp % ./a.out Hello World! What else shall I do to make this g++ compiler work?
2
0
449
Mar ’25
Unable to Test Xamarin App with iOS 26 Simulators in Visual Studio
Hello, I’m trying to test a Xamarin.iOS application using the iOS 26 simulators in Mac Visual Studio, but I’m encountering an issue where the simulators are not appearing or accessible from Visual Studio. Details: macOS version: 15.6 (24G84) Xcode version: 26 Beta 5 Visual Studio version: 17.6.0.80 Xamarin.iOS version: Xamarin.Forms (Version: 4.6.0.1180) using XAML for cross-platform support (iOS/Android) The problem started after updating to iOS 26 SDK. I am unable to select or run the app on any iOS 26 simulator from Visual Studio. Has anyone faced a similar issue? Is there any configuration or workaround to enable iOS 26 simulators for Xamarin projects? Thanks in advance for your help.
2
0
44
Aug ’25
Why is data not encrypted on icloud.developer.apple.com when i am using encrypted field
Here is my sample code of integration with iCloud let dbName = "GroceryItem1" let fieldName = "todoTitle1" @objc func saveItem(name: String) { let record = CKRecord(recordType: dbName) record.encryptedValues[fieldName] = name database.save(record) { record, error in if error == nil { DispatchQueue.main.asyncAfter(deadline: .now() + 2) { self.fetchItems() } } else { print("Error saving item: \(error?.localizedDescription ?? "Unknown error")") } } } Now my code works fine but what i don't understand is when i login to icloud.developer.apple.com why am i able to see the data, why is it not encrypted? My database is private as well If i go to record types i can see the recordfield is encrypted as shown in below screenshot
2
0
306
Dec ’24
An Apple Developers Rant.... (So upset...)
Hello Everyone, (and I hope folks at Apple are listening) So around a year ago, I decided to take on the challenge of creating my own Iphone App from scratch. I am an engineer by trade, and thought it would be a fun interesting experience, and maybe make some money on the side. So I bought a macbook, and focused on learning Swift for the next few months. Lots of really great developer folks helped me along the way. And I could not have been successful without so much help. It is very much appreciated. So I finished the app, created my own company. And deployed it to the Istore. Unfortunately, just no interest, I think I sold like 4 copies. No problem, still got to learn a lot along the way. So when it came time to renew my developer licence, I let it expire. Just did not make any sense to drop another $100 into it, since only 4 copies had sold in a year. And then..... this happened!!!! I attempted to use the App that was installed on my own Iphone.... and got the message "My Apps Name" is no longer Available. and it stops... The code is on my phone. I am fully aware that I can no longer use xcode to put anything else on my iphone without a developer licence. But for Apple to reach into my own Iphone, and deny my access to something that I already created, (and in theory already paid for) is just infuriating!!! I checked, and even though it no longer exists in the IStore, purchased copies still seem to function. (one person that bought a copy was a friend of mine). So do I really need to drop another $100, puchase an actual copy of MY OWN APP from the app store, just to have it on my own phone again???!!! So much money and time went into this, that I am considering just smashing every apple product I own, and go with Android instead. I am a single person developer. Almost no one does this sort of thing anymore. Apple used to be the place where innovators could come to try to make something cool and fun to use. I guess not any more. Dan
2
0
302
Feb ’25
Simulate Background Fetch Not Working on Real Device, Works on Simulator
Hello Apple Support, I’m facing an issue with Background Fetch in my React Native project. When I click on Simulate Background Fetch in Xcode, everything works as expected on the iOS Simulator—background tasks run smoothly, and data is fetched without issues. However, on a real device, the app goes to the background but doesn’t execute any of the scheduled background tasks, and it also remains in the background without terminating. Here’s some additional context: React Native Project: I’m using React Native to develop this app, and the background tasks involve: Getting User Location: Fetching the user’s location in the background. API Calls: Calling an API to fetch necessary information based on the user’s location. Scheduling Notifications and Alarms: Scheduling notifications and alarms based on the API response data. Simulator vs. Real Device: In the iOS Simulator, all these background tasks trigger and function correctly when I simulate Background Fetch. On the real device, however, none of these tasks are triggered when I try to simulate Background Fetch. The app only moves to the background without performing any tasks or getting terminated. Device and Configuration Details: iOS Version: 17 Device Model: Iphone xs, Iphone 11, iphone 7 Background Modes: Background Fetch is enabled in Capabilities, and I’ve set the fetch interval to the minimum for testing. I’ve verified that all configurations are correctly set, and I’ve tried restarting the device and Xcode, but the issue persists. Is there something specific about Background Fetch that could prevent it from functioning as expected on physical devices? Any guidance on troubleshooting or additional steps would be highly appreciated. Thank you!
2
0
912
May ’25
Unable to get Metric Kit logs on iOS devices for past 24 hours on Test Flight Build
https://developer.apple.com/documentation/metrickit I am unable to get the MetricKit logs for past 24 hours time period on my test flight build. I have been able to achieve immediate logs for crash, cpu exception and diskwrite exceptions. But the logs which contains all the crashes, cpu exceptions and diskwrite exceptions, battery and network details, etc for the previous day/24h are never generated. I have used the following method to log the payloads in the file systems. I have tested the same on normal xcode builds as well as TestFlight build. func didReceive(_ payloads: [MXDiagnosticPayload]) https://developer.apple.com/documentation/metrickit/mxmetricmanagersubscriber/didreceive(_:)-9yd4u
2
0
519
Oct ’24
Simulator package issues
Hi! My simulator will not build because there is essentially a package conflict. I am adding Firebase to a Flutter application. Simulator built before trying to add firebase but now I'm getting errors telling me a package can't be found even though it's installed Output Package Loading (Xcode): Missing package product 'FirebaseCore' .../ios/Runner.xcodeproj I added target 'Runner' do use_frameworks! use_modular_headers! pod 'FirebaseDatabase' pod 'FirebaseAnalytics' pod 'FirebaseMessaging' pod 'FirebaseCore' pod 'FirebaseFunctions' pod 'FirebaseAppCheck' pod 'FirebaseFirestore' pod 'FirebaseStorage' pod 'FirebaseDynamicLinks' pod 'FirebaseAuth' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) target 'RunnerTests' do inherit! :search_paths end end and ran pod install with no errors. Opening the runnner.xcworkspace shows all of the named packages under "Frameworks, Libraries, and Embedded Content' I've tried manually adding through Xcode those packages but then get a conflict error, so I am out of ideas as to how to fix this. It appears to be something new with the latest MacOS update as I've seen another person with the same problem that started after he updated... I've also cleaned, re-installed, re-booted a few times because My Android emulator builds fine Any help would be appreciated! Thanks!
2
0
507
Nov ’24