Welcome to the Apple Developer Forums

Post your questions, exchange knowledge, and connect with fellow developers and Apple engineers on a variety of software development topics.

For questions about using Apple hardware and services, visit Apple Support Communities

Posts

Sort by:
Post not yet marked as solved
0 Replies
6 Views
We have encountered a problem where the dyld ends up using the incorrect dylib. Here's the use case: Plugin A (a bundle) depends on Dynamic Library A - referenced with "@loader_path". Plugin B (a bundle) depends on Dynamic Library B - referenced with "@loader_path". Relevant File (binaries) layout is like this: MyPluginA.bundle/Contents/MacOS/MyPluginA [depends on @loader_path/../../../MyLibraryA.framework/MyLibrary] MyLibraryA.framework/MyLibrary MyPluginB.bundle/Contents/MacOS/MyPluginB [depends on @loader_path/../../../MyLibraryB.framework/MyLibrary] MyLibraryB.framework/MyLibrary This scheme works fine on most machines. But on some Macs, dyld tries to link MyPluginB with the library in MyLibraryA - which causes the plugin not to be loaded because it cannot find the required symbols in the library. If we try to print dyld debug information, it shows that MyLibraryB is loaded and then unloaded, without showing any reason. And following that, the MyPluginB tries to look for MyLibraryB's symbols in MyLibraryA. Can this be due to some kind of caching done by dyld? Why is the @loader_path not being used to refer to the actual library being used?
Posted
by
Post not yet marked as solved
0 Replies
4 Views
Hi. My MacOS application (Obj-C, Cocoa MacOS 10.15 or later) sets itself as delegate for UNNotificationCenter, and implements both - (void)userNotificationCenter:(UNUserNotificationCenter *)center        willPresentNotification:(UNNotification *)notification          withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler and - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response          withCompletionHandler:(nonnull void (^)(void))completionHandler It creates and schedules many user-notifications (mostly with no "trigger" meaning - present to the user ASAP and sometimes 2.5 seconds in the future, so to group notifications better. Each notification is also holding som dictionary of "UserInfo" containing some data. My AppDelegates handles user responses (both standard open, cancellation, and "cancel-all") and also custom user-actions I attach to the category. All works well on most Macs and almost always. However - On few Macs, at arbitrary times, users complain that "clicking a notification in Notification Center will not open the app" and that "expected notifications are missing altogether". My logs show the following. Quite frequently I see the following: error log lines: 2023-02-16 17:32:21.413065+0200 0xa58109d Error 0x0 51690 0 <UserNotifications`__104-[UNUserNotificationServiceConnection addNotificationRequest:forBundleIdentifier:withCompletionHandler:]_block_invoke_2.cold.1> myApp: (UserNotifications) [com.apple.UserNotifications:Connections] [com.myCompany.myApp] Adding notification request failed with error: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 451 named com.apple.usernotifications.usernotificationservice" UserInfo={NSDebugDescription=connection to service on pid 451 named com.apple.usernotifications.usernotificationservice} followed by my own log lines - like this: 2023-02-16 17:32:21.413279+0200 0xa5811b5 Error 0x0 51690 10 <myApp> myApp: [com.myCompany.myApp:UI] NotificationRequest B6096CDE-6229-42AA-A6BC-EBCC06540C53 stage:scanFinished failed to schedule: Error Domain=NSCocoaErrorDomain Code=4097 "connection to service on pid 451 named com.apple.usernotifications.usernotificationservice" UserInfo={NSDebugDescription=connection to service on pid 451 named com.apple.usernotifications.usernotificationservice} Of course - the un-scheduled notification won't appear to the user, but worse - clicks on other, DELIVERED notifications, won't call back my delegate. Strangely enough - few seconds later, sometimes minutes - other attempts to schedule new notifications - succeed without any error. I guess this "connection" is somehow automatically re-established. I looked for information about this error (Domain=NSCocoaErrorDomain Code=4097) and it seems to be pretty generic, and used for many scenarios where connection to some service is lost. Of course my code doesn't maintain any such connection manually/programmatically - I guess it is the [UNUserNotificationCenter currentNotificationCenter] implementation which holds connection to its "daemon" or "agent" or some XPC service. The really bad thing here - is that I DO NOT KNOW how to improve anything here. [UNUserNotificationCenter currentNotificationCenter] Is a singleton, that I can't control, or re-create, to somehow revive the connection There is no way I know of, to tell it to do so, or even to check whether it has a connection. I rely on Notification-Center to maintain my MODEL DATA for scheduled requests, in case my App is relaunched - and now I can't get it. Please advise. this is quite urgent for me. The issue appears more on Big Sur.
Posted
by
Post not yet marked as solved
0 Replies
15 Views
We are facing a issue, when the app goes to background and we try to get back to foreground, the app crashes. Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x00000001c4864200 __pthread_kill + 8 1 libsystem_pthread.dylib 0x00000001d4cc61ac pthread_kill + 268 (pthread.c:1670) 2 libsystem_c.dylib 0x000000018f2f53e4 __abort + 128 (abort.c:155) 3 libsystem_c.dylib 0x000000018f29dc98 abort + 192 (abort.c:126) 4 libc++abi.dylib 0x00000001d4c06b8c abort_message + 132 (abort_message.cpp:78) 5 libc++abi.dylib 0x00000001d4bf6a68 demangling_terminate_handler() + 312 (cxa_default_handlers.cpp:66) 6 libobjc.A.dylib 0x0000000180f9dd4c _objc_terminate() + 160 (objc-exception.mm:501) 7 FirebaseCrashlytics 0x000000010560bdcc FIRCLSTerminateHandler() + 340 (FIRCLSException.mm:452) 8 libc++abi.dylib 0x00000001d4c05f28 std::__terminate(void (*)()) + 20 (cxa_handlers.cpp:59) 9 libc++abi.dylib 0x00000001d4c05ec4 std::terminate() + 56 (cxa_handlers.cpp:88) 10 libdispatch.dylib 0x000000018f239ff0 _dispatch_client_callout + 40 (object.m:563) 11 libdispatch.dylib 0x000000018f23da5c _dispatch_block_invoke_direct + 264 (queue.c:496) 12 FrontBoardServices 0x000000019d8933b0 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52 (FBSSerialQueue.m:157) 13 FrontBoardServices 0x000000019d892f4c -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220 (FBSSerialQueue.m:181) 14 FrontBoardServices 0x000000019d89572c -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:194) 15 CoreFoundation 0x0000000187d35f54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957) 16 CoreFoundation 0x0000000187d4232c __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001) 17 CoreFoundation 0x0000000187cc6210 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038) 18 CoreFoundation 0x0000000187cdbba8 __CFRunLoopRun + 836 (CFRunLoop.c:2953) 19 CoreFoundation 0x0000000187ce0ed4 CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 20 GraphicsServices 0x00000001c0fde368 GSEventRunModal + 164 (GSEvent.c:2196) 21 UIKitCore 0x000000018a1bf3d0 -[UIApplication _run] + 888 (UIApplication.m:3745) 22 UIKitCore 0x000000018a1bf034 UIApplicationMain + 340 (UIApplication.m:5335) 23 Runner 0x000000010044f304 main + 68 (AppDelegate.swift:11) 24 dyld 0x00000001a6348960 start + 2528 (dyldMain.cpp:1170)
Posted
by
Post not yet marked as solved
1 Replies
13 Views
I wrote an app that successfully adds a cycling workout to HealthKit. I can see in the Health app that there are new entries under "Workouts", "Active Energy", and "Exercise Minutes" all from me just adding an HKWorkout and a HKQuantitySample. However, there is no new entry for "Cycling Distance". I assumed that since the workout I added includes the fact that the activityType is HKWorkoutActivityType.cycling and I provided the distance, that it would also add an entry for "Cycling Distance". Is there something extra I need to do to get that?
Posted
by
Post not yet marked as solved
0 Replies
13 Views
Exporting pdf from Safari is the best export tool by far, comparing all the existing ones of other browsers. Great job, Apple!! It is very useful for rendering web pages to pdf for signing documents for legal purposes. But here is the problem: Safari cannot generate page breaks in din A4 format. The pdf resulting from the export is two or three pages with different rare page sizes. If it were possible to preset the page size would be perfect. That way, it could also be printed if needed. Thank you in advance for your help. Pablo
Posted
by
Post not yet marked as solved
0 Replies
12 Views
Is it a feature of Developer Mode that apps constantly relaunch? I wonder if it’s this, or some other reason. My phone is not the newest but I don’t see this behaviour with DM off. It makes it difficult to gauge how often my app actually need to relaunch, when it’s relaunching every time. Xcode 13.4.1, iOS 16.3.1
Posted
by
DMG
Post not yet marked as solved
0 Replies
15 Views
I desperately need a reliable tutorial on creating and implementing a Privileged Helper for this app I'm creating. I have found a couple of resources on the web, but they are not well-written and dated. Can anyone help point me in the right direction? Documentation seems to be very sparse.
Posted
by
Post not yet marked as solved
0 Replies
14 Views
I am trying to modify an existing bundle so that I can notarize it. Here its organisation: graps.app Contents MacOS prelaunch <-- main applauncher grasp <-- auxiliary binary calling the libraries Here the original DYLD_LIBRARY_PATH: DYLD_LIBRARY_PATH="." DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/MATLAB/MATLAB_Runtime/v911/runtime/maci64" DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/MATLAB/MATLAB_Runtime/v911/bin/maci64" DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/MATLAB/MATLAB_Runtime/v911/sys/os/maci64" export DYLD_LIBRARY_PATH and the RPATHs that mimic it: install_name_tool -add_rpath "/." grasp install_name_tool -add_rpath "/Applications/MATLAB/MATLAB_Runtime/v911/bin/maci64" grasp install_name_tool -add_rpath "/Applications/MATLAB/MATLAB_Runtime/v911/runtime/maci64" grasp install_name_tool -add_rpath "/Applications/MATLAB/MATLAB_Runtime/v911/sys/os/maci64" grasp install_name_tool -add_rpath "/Applications/MATLAB/MATLAB_Runtime/v911/extern/bin/maci64" grasp Note that it is not enough to add RPATHs to the auxiliary binary "grasp". They must also be added to the main binary "prelaunch". But why ? 1- Unsigned application using DYLD_LIBRARY_PATH set RPATHs set DYLD_LIBRARY_PATH not set DYLD_PRINT_LIBRARIES ### App running ### 2- Unsigned application with lib tracking set RPATHs set DYLD_LIBRARY_PATH set DYLD_PRINT_LIBRARIES ### App hangs after loading 894 libraries (MatLab has more than 3000 libs and uses many macOS libs) ### The terminal output is a total of 119594 characters. ### Is this more than allowed by `DYLD_PRINT_LIBRARIES`? ### As a consequence the check cannot be completed. Too bad !!! 3- Unsigned application using RPATHs set RPATHs not set DYLD_LIBRARY_PATH set or not DYLD_PRINT_LIBRARIES ### Error: Could not find version 9.11 of the MATLAB Runtime. ### Attempting to load libmwmclmcrrt.9.11.dylib. <-- it does not say "not found"! 307 libs are loaded before this error message occurs 59 are MatLab libs all from /bin/maci64 but the following one is from /runtime/maci64 libmwmclmcrrt.9.11.dylib is the 13th lib loaded and the 6th MatLab one: dyld: loaded: <11D060E5-13C3-34EE-96C9-A7EA2A7E34B3> /Applications/MATLAB/MATLAB_Runtime/v911/runtime/maci64/libmwmclmcrrt.9.11.dylib Note that MacOS does not say "not found" Thus RPATH does not seem to behave exactly as DYLD_LIBRARY_PATH did but why? How can "ignoring DYLD_LIBRARY_PATH" break a library loading ? How can I debug this ? This is very disappointing since, otherwise, the application would easily sign and notarize. I have exhausted all the tracks I knew and found on the internet. Alain
Posted
by
Post not yet marked as solved
0 Replies
21 Views
Asset validation failed CFBundleldentifier Collision. There is more than one bundle with the CFBundleldentifier value 'com.icanspell.app' under the IOS application 'Runner.app'. (ID: 15f7aa4e- d2c3-461c-8438-5a4b21ad8aff) Asset validation failed Bad bundle identifier. The bundle Identifier 'com.icanspell.app' of the application extension Runner.app/Plugins/OneSignalNotificationServiceExtension.appex should start with the application's bundle identifier 'com.icanspell.app' and not contain more than one period ** after the application's bundle ID. (ID: e1b681c4-ef94-4bfa-a948-119696790d4e) I am facing this error. & confused where should i change my bundle id. Please help
Posted
by
Post not yet marked as solved
0 Replies
15 Views
Having set up multiple targets in Xcode (by duplicating the initial one), everything starts off working fine. Then, some reference/inheritance on the "Pod-App" xcconfig files seem to break and pods are no longer found for my second target ("App Staging") resulting in the commonly known "No such module" errors when building. I could nail down the reason in my case but I don't know why it happens or how to fix it (except for going through the whole process again of duplicating the initial target). Also, because there are no changes visible among the project files looking at git. Initial, working state which is always there for my first target and initially also for the second, duplicated target: Then, without purposefully changing anything nor seeing any changes in the project files, the reference to the config files is suddenly missing for the second target. The only thing I imagine doing before that happens, is to build for another device/simulator. Why could this break? How can I link it again to fix the problem?
Posted
by
Post not yet marked as solved
1 Replies
26 Views
I have a simple picker with weight selection, but how to write the code to save the selected weightIndex value? I thought of using UserDefaults, but I don't know how to save the numbers. Is there a way that would work please? import SwiftUI struct TestPickerView: View { @State private var weightIndex = 20 @State private var isWeight = false @State private var isExpanded = false var Weight = Array(20...180) var body: some View { NavigationView { List { DisclosureGroup("Weight: \(weightIndex) kg", isExpanded: $isWeight) { VStack { Picker("", selection: $weightIndex) { ForEach(Weight, id: \.self) { Text("\($0.formatted(.number.grouping(.never)))") } } }.pickerStyle(WheelPickerStyle()) } } } } } struct TestPickerView_Previews: PreviewProvider { static var previews: some View { TestPickerView() } } Does anyone know how to save the selected weight number and save it?
Posted
by
Post not yet marked as solved
3 Replies
34 Views
If possible, I am trying to create a tuple where one of the values can be modified and used for the expected argument Binding. Can this be done? Thank you.
Posted
by
Post not yet marked as solved
0 Replies
16 Views
Hi, we are building an app to sync contacts for event organization. The app can sync between 100 to 1000 contacts to the Contacts app of iOS. We can't manage the device because the user can bring their own device. We are currently facing an issue with thirdparty application like Whatsapp/Signal/Telegram because they sync the contacts from and to the phone. When the sync is enabled in one of this app we can't delete all the contacts at the end of the event because they are synced back to the Contacts app. When we update the contact it also get messed up by those apps. Do you know an workaround to prevent this scenario? Is it possible to prevent thos apps to sync a contact?
Posted
by
Post not yet marked as solved
0 Replies
18 Views
Hi, I have installed tensorflow-macos on an apple-silicon machine, but I am unable to correctly install tensorflow-datasets. Here what I am doing: conda create -n myenv python=3.10 -c conda-forge conda activate myenv conda install -c apple tensorflow-deps python -m pip install tensorflow-macos python -m pip install tensorflow-metal python -m pip install tensorflow-datasets Here I run into an error: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow-macos 2.11.0 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.3 which is incompatible. Successfully installed click-8.1.3 dm-tree-0.1.8 etils-1.0.0 googleapis-common-protos-1.58.0 importlib_resources-5.12.0 promise-2.3 protobuf-3.20.3 psutil-5.9.4 tensorflow-datasets-4.8.3 tensorflow-metadata-1.12.0 toml-0.10.2 tqdm-4.64.1 zipp-3.15.0 I am also trying to install KerasCV with Custom Ops from source and I run into the same dependency error on protobuf. It seems that one of the dependencies of tensorflow-datasets and KerasCV requires protobuf 3.20, which in turn is not compatible with my version of tensorflow-macos. If I try to downgrade protobuf to version 3.19.4 I get: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. googleapis-common-protos 1.58.0 requires protobuf!=3.20.0,!=3.20.1,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.19.5, but you have protobuf 3.19.4 which is incompatible. Here some information about the package versions: tensorflow-datasets    4.8.3          pypi_0  pypi tensorflow-deps      2.10.0            0  apple tensorflow-estimator   2.11.0          pypi_0  pypi tensorflow-macos     2.11.0          pypi_0  pypi tensorflow-metadata    1.12.0          pypi_0  pypi tensorflow-metal     0.7.1          pypi_0  pypi Has anyone been able to create an environment with the correct dependencies?
Posted
by
Post not yet marked as solved
1 Replies
26 Views
I am a beginner in SwiftUI. My task to capture the image of the whole screen using SwiftUI includes other apps and title bar. I am unable to show the permission dialog of screen recording and capturing the image of the screen. I have implemented the solution below but did not get success. func screenshotWindowAndSuccess() -> Bool { let task = Process() task.launchPath = "/usr/sbin/screencapture" task.arguments = ["-cm"] task.launch() task.waitUntilExit() let status = task.terminationStatus return status == 0 } Please help me to get out of this task. Thank you in advance!
Posted
by
Post not yet marked as solved
0 Replies
15 Views
Hello everyone, I'm developing a Xamarin Forms app on Windows and debugging on the Macbook, in debug the app works correctly both on the simulator and on the physical iPhone, but when I try to run the compiled app on the AppStore, it crashes at the time of login, I believe it can be at the moment that it will save Local Database.
Posted
by
Post not yet marked as solved
3 Replies
43 Views
Guideline 1.1.6 - Safety - Objectionable Content Your app contains content or features that are misleading, intended to deceive users, or are otherwise fraudulent. Your app contains content or features that are misleading, intended to deceive users, or are otherwise fraudulent. Specifically, your app metadata contains misleading content. Please note that adding a disclaimer to the app description is not sufficient if the rest of the metadata and the app are misleading. Next Steps It would be appropriate to remove any content or features from your app that could be misleading or enable fraudulent activity before resubmitting for review. The next submission of this app may require a longer review time. Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination. Resources Learn more about our requirements regarding objectionable content in App Store Review Guideline 1.1. iOS App 1.2App Version Rejection Reasons: 1.1.6 Safety: Objectionable Content
Posted
by
Post not yet marked as solved
0 Replies
15 Views
Is it possible to open a Keynote file in the iOS-Keynote App from my app? I tried with shortcuts, but do not know how to pass the file as input. I took the shortcut "Open Presentation" to open a file with Keynote, but it does not take my file as input. It always asked "Which presentation?" if I run this code: NSString *shortcutURL = [NSString stringWithFormat:@"shortcuts://run-shortcut?name=%@&input=%@", myShortcutName, filePathToKeynote]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:shortcutURL] options:@{} completionHandler:nil]; Is there any other option to directly open the file in Keynote without showing a dialog where the user has to pick the Keynote App first? I know it's possible with UIActivityViewController, but I want to avoid showing the dialog where the user has to choose the application.
Posted
by

Pinned Posts

Categories

See all