Post

Replies

Boosts

Views

Activity

Issues with SwiftData @Relationships in Swift Testing
Is it a known issue that when attempting to test SwiftData objects with relationships in Swift Testing there are errors that do not occur when the app is running? Example: @Relationship(deleteRule: .cascade, inverse: \MBAccount.book) var accounts: [MBAccount] = [] and @Relationship var book: Microbook? Then the test: let book = Microbook(name: "Julia's Cupcakes") let account1 = MBAccount(name: "Chase Business Account") let account2 = MBAccount(name: "Cash Drawer") account1.book = book account2.book = book #expect(account1.name == "Chase Business Account") #expect(account2.type == "asset") } Produces a fatal error while running test: SwiftData/PersistentModel.swift:321: Fatal error: Unable to find relationship on MBAccount for KeyPath \MBAccount.book Any ideas?
0
0
13
3h
UI Tests Runner application does not launch manually.
I need to run my tests bundle independently from Xcode. Previously, I used to deploy it and run as regular iOS application, it would execute test cases and display 'Automation running' label. I needed to execute tests some time after deploy and in different time of the day, so it is a problem for my team right now. So, UI Tests Runner app file does not launch and 'Automation Running' label is not displayed, is there any possible ways to run tests as it was or other ways to run tests not from Xcode.
0
0
30
5h
WidgetKit Simulator is missing in first Sequoia beta?
I updated to Sequoia beta 1 and seem to have lost the macOS widgetkit simulator. is this expected? My other mac running sonoma still has the simulator located at: /System/Library/CoreServices/WidgetKit Simulator.app trying to launch my widgets from Xcode 16 beta on my mac running sequoia results in this error: Couldn't find LSBundleProxy for provided bundle identifier: com.apple.widgetkit.simulator Domain: com.apple.dt.deviceservices.error Code: 3 User Info: { DVTErrorCreationDateKey = "2024-06-18 07:51:54 +0000"; IDERunOperationFailingWorker = IDELaunchServicesLauncher; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "00008112-0006250411FB401E"; "device_model" = "Mac14,2"; "device_osBuild" = "15.0 (24A5264n)"; "device_platform" = "com.apple.platform.macosx"; "device_thinningType" = "Mac14,2"; "dvt_coredevice_version" = "397.3.5.1"; "dvt_coresimulator_version" = 980; "dvt_mobiledevice_version" = "1757.0.0.101.1"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 1; "operation_errorCode" = 3; "operation_errorDomain" = "com.apple.dt.deviceservices.error"; "operation_errorWorker" = IDELaunchServicesLauncher; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 1; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 1; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.macosx"; "param_diag_113575882_enable" = 0; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 2; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 2; "param_runnable_appExtensionHostRunMode" = 1; "param_runnable_productType" = "com.apple.product-type.app-extension"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "macosx15.0"; "sdk_osVersion" = "15.0"; "sdk_variant" = macos; } -- System Information macOS Version 15.0 (Build 24A5264n) Xcode 16.0 (23037.4) (Build 16A5171c) Timestamp: 2024-06-18T19:51:54+12:00
1
0
23
5h
Crash in Xcode code review
Crash in Xcode code review When you enable Enable Code Review in the upper right corner of Xcode, Xcode crashes or loads infinitely. I don't think this problem existed in previous versions of Xcode, but it is very serious in the current version 15.4. It doesn't crash in all parts of Code Review, but Xcode crashes or loads infinitely in certain parts. I really hope this will be fixed in the next Xcode version. It happens so often that I'm going crazy. Seriously Especially if there are many or wide changes in the swift file, the crash occurs in that part.
0
0
36
8h
Swift Student Challenge Winner Proof
I was a Swift Student Challenge winner in 2020 and 2021 and I was wondering if there was somewhere I could receive a confirmation of my winner status? I’m currently building a petition for an O1 visa, and my attorney told me that the screenshots I have of the website from when I won many years ago would probably not be sufficient as they’re cropped and not of the full screen. I have no way to go back to the old status page or even the events tab in the developer account page since it was removed. Is there somewhere on the developer website I should look? Is there a way to get something sent by Apple to help me out here? I've sent an email to swiftstudentchallenge@ apple.com but haven't received a response just yet so thought I'd ask here too. I feel like this should be possible somehow, even for just using on a resume for example. It's why I assumed the events tab existed.
0
0
43
10h
xcodebuild segmentation fault
I am getting a segmentation fault with xcodebuild: 2024-06-17 17:08:52.749 xcodebuild[26052:114044] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/m0/fb9pgvx50vngfz_tcpgyxzhw0000gn/T/macnbagent_2024-06-17_17-08-52.747.xcdistributionlogs". zsh: segmentation fault /usr/bin/xcodebuild -exportArchive -archivePath -exportOptionsPlist Version: xcodebuild -version Xcode 15.4 Build version 15F31d Is there any know segmentation fault bug with xcodebuild?
0
0
47
12h
Running application on 17.4 Simulator from Xcode 16.0 beta is crashing due to missing SwiftUICore.framework
Hi, I have a project that is pretty complex and includes mostly UIKit/Swift code with some SwiftUI added on top. I also have some SPM modules and internal Cocoapods libraries linking in. The project builds fine with the latest release version of Xcode (15) and runs on 17.4 simulator. WIth Xcode 16.0 Beta however, the project builds and runs fine on iOS 18 simulators, however there is a specific crash that happens at startup on iOS 17.4 simulators. Please see crash log below with the name of my application redacted: dyld[91294]: Library not loaded: /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore Referenced from: <14C085D7-ECA8-3287-8038-5DE320ADCEBD> /Users/xxxxxx/Library/Developer/CoreSimulator/Devices/C23AA8A9-8475-4EE2-86B3-136A0EBCC362/data/Containers/Bundle/Application/95A49FCF-A7E3-4A8B-93F1-C4CDDBA74B60/xxxxxx.app/Frameworks/SwiftUI_Common.framework/SwiftUI_Common Reason: tried: '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/xxxxxx-fglltpkbphqqjzgdgdadysinonmq/Build/Products/Debug-iphonesimulator/SwiftUICore.framework/SwiftUICore' (no such file), '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/xxxxxx-fglltpkbphqqjzgdgdadysinonmq/Build/Products/Debug-iphonesimulator/PackageFrameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file, not in dyld cache), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file) It seems like for some reason Xcode is building the app thinking there would be a SwiftUICore.framework on device, but since this framework is new in iOS 18 and does not exist on iOS 17.4, the system is unable to find it and crashes. I have the min deployment target set to iOS 14.5, so I'm not sure why Xcode would make the assumption that SwiftUICore.framework will be available for linking on runtime. Interestingly, I cannot reproduce this same issue on a clean project created using Xcode 16 and targeting min deployment of iOS 15. I was wondering if anyone has any suggestions regarding specific build settings to check and see where the issue might be coming from. Thanks
0
0
37
13h
Gather Crash Logs for Tunnel Extension
Our iOS app also has a Safari Extension and a Packet Tunnel Extension. When trying to gather crash logs from the packet tunnel extension, we get an error like: ***@***[dot]com failed with error: Access Restricted. Even the account holder account was unable to access these crash logs. Is there any access level that does allow access, or are they restricted in all cases for all permission levels?
0
0
35
17h
How to configure Signin with Google in Xcode 15 for IOS
I'm working on my 1st IOS app and I'm trying to follow the instructions from: https://developers.google.com/identity/sign-in/ios/start-integrating It instructs me to edit the info.plist file but I can't find it in my project (it appears that Xcode 15 doesn't generate the file anymore?). Do I have to add the Google client IDs somewhere else in the UI? If yes, does anyone have links to a step-by-step instruction on how to do it? I'm really new to this. Thanks!
0
0
30
18h
Bug Accessing Multiline SwiftUI TextFields in UITests
Hello, I am wondering if anyone else has seen this bug: Create a multiline TextField like so: TextField("a string", text: $myDataStore.placeholder, axis: .vertical) .accessibilityIdentifier("placeholder") .multilineTextAlignment(.leading) .lineLimit(...3) .textFieldStyle(CustomTextFieldStyle(text: $myDataStore.placeholder, hasErrors: myDataStore.placeholder.isEmpty)) Then create a UITest that accesses it. let multilineTextField = app.textViews["placeholder"] // note that multiline textFields can only be accessed as textVIEWS, not textFIELDS. They simply do not appear under po.textFields let exists = multilineTextField.waitForExistence(timeout: 3) XCTAssertTrue(exists, "The field did not appear in time.") multilineTextField.tap() // everything is fine up to here //BUG: multiline textfields will not tap into keyboard on larger device types like the iPhone 15, but they will on SEs. multilineTextField.typeText("A Test") // fails on anything other than an SE, "Neither element nor any descendant has keyboard focus" What is happening here?
0
0
46
18h
Xcode 15.4 from the App Store will not open on MacOS 14.5
Howdy! New Apple developer here, running a MBP 2023 M2. A year ago I used Xcode to test a Flutter app I was working on, as well as a Godot app I was making. It worked fine to open, edit, and test those projects in the simulator. Today I attempted to open Xcode and it would never load past the following window: I let it sit there and spin for probably 30 minutes while I did other tasks, but it never changed. Here is what I tried after discovering the issue: Google various generic terms relating to "No selection" and "xcode". Restart the computer. No change. Update MacOS. I hadn't updated to the latest 14.5. No change afterward when opening Xcode. Update Xcode. I updated to the latest version in the App Store 15.4. No change after update. Remove Xcode (move app to Trash from Applications, remove Library/Developer, empty trash) and fresh install from App Store. No change when opening Xcode. Reinstall command line tools (since they were removed in step 3) "xcode-select --install" and then used the UI to continue install. No change. I can't really think of what else to do, as there's not a lot of information to go off of. I don't even know what that loading screen is supposed to show when it works (maybe a list of recent projects?). All options on the Xcode menu bar and the window itself are unresponsive and just show the spinning beach ball as the cursor. What else can I do to 'reset' Xcode, and/or to clear out whatever files are preventing it from loading? Thank you in advance!
3
0
62
19h
Binding to Shared User Defaults might fail in Xcode storyboards
While binding to the Shared User Defaults in .xib files is very easy I had hard times to achieve application wide preferences in projects based on storyboards. The behavior is a bit strange/unexpected and even in Xcode 15.4 it seams not to be completely solved. Issue is that IB only creates a single instance of a Shared User Default controller for the first scene, where it was requested and linking to this instance from other scenes offers no functionality. Even worse IB suggests this as first binding proposal. Here an example to deal with this issue. add slider and label to view of ViewController in IB storyboard add MenuItem to windows menu in the Application Scene When running the app this menu item remains disabled as no action is connected bind value of the created menu item to the Shared User Defaults with Model Key Path: “showTerminal“ This creates a Shared User Defaults Controller instance that we use later. Now running the app the menu item is enabled and the checkmark toggles each time add a checkbox to the view add a User Default Controller to the View Controller Scene This must be repeated for any further Window- or View- Controller scene where a binding to the user defaults is required. bind the checkbox to the newly added User Defaults Controller (but not the Shared User Defaults Controller) keeping the suggested Controller key values and set the Model Key Path to “showTerminal“ as above now bind the slider and the label to the same User Defaults controller using an identical Model key If accidentally bound to the Shared User Defaults Controller (this is what IB suggests) no functional binding will take place! Register the defaults early (before the nib is being loaded) to set default values like for example: class AppDelegate: NSObject, NSApplicationDelegate { override init() { super.init() UserDefaults.standard.register(defaults: [ "first": 0.0 , "showTerminal": false ] ) } … } [https://github.com/MissingManual/UserDefaultsBindingsInStoryboard] ATTENTION: Suggestion is, to create the first Defaults Controller as a Shared User Defaults Controller inside the Application scene. Somehow Xcode remembers settings of the Shared User Default Controller and otherwise bindings might fail. MESSAGE: Never bind to the “Shared User Default Controller“ but to individually created “User Default Controller“ for every scene, unless it is the very first time. Alternatively you can set a let variable as @objc let defaults = UserDefaults.standard for example in each ViewController and then bind to this by Bind to: ViewController Controller Key: Model Key Path: defaults.
0
0
38
23h
Apple Developer Program membership has expired
I am writing to seek assistance with renewing my Apple Developer Membership. Unfortunately, I do not see the renew button in my Apple Developer account, and it is showing the message "Your Apple Developer Program membership has expired." Previously, the payment was made using an Apple ID of a developer who is no longer working with us. As a result, I am unable to renew the membership with the current setup. Could you please assist in mapping the subscription to my preferred Apple ID: [?????????????] ? Your support in resolving this issue would be greatly appreciated.
1
0
43
1d
Enable code coverage in the build settings of a particular target
We got an app that uses DriverKit. So we have the main target of the app and another target for DriverKit. We would like to turn on code coverage for testing. To do so we enable it in the scheme settings. Unfortunately this doesn't work because DriverKit doesn't support code coverage option. This happens because all settings set in the scheme settings get carry out for all the targets. So this the error you get: File cannot be open)ed, errno=2 path=/Applications/code.app/Contents/Developer/Toolchains/XcodeDefault.ctoolchain/usr/lib/clang/15.0.0/ lib/darwin/libclang_rt.profile_driverkit.a in '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/ 15.0.0/lib/darwin/libclang_rt.profile_driverkit.a' After talking with a couple of Apple engineers ( thanks for your help btw :) ) about a similar problem related with Address Sanitiser, they helped me adding a custom setting in build settings for the main target so address sanitiser can be enabled only for the main target. Unfortunately we didn't have enough time to cover the code coverage problem and they suggested to post a question in this forum to find out the KEY to set up code coverage in build settings Thanks
1
0
51
1d
Inconsistency in the DeviceActivityEvent callbacks
We are using the Apple ScreenTime API for monitoring the usage of device. As mentioned in the documentation (https://developer.apple.com/documentation/familycontrols), we are getting the family controls authorisation from the user. We also have added the ‘DeviceActivityMonitor’ app extension (https://developer.apple.com/documentation/deviceactivity/deviceactivitymonitor) to receive the schedule and event callbacks. We have a requirement in which we have to notify the user for every 15 minutes usage of the device in the specified interval. He can optionally select individual categories or applications for the 15 minutes notification. For monitoring the usage for individual categories or applications, we obtain the token by presenting the FamilyActivityPicker as discussed in this documentation https://developer.apple.com/documentation/familycontrols/familyactivitypicker. For simplicity in testing during the development phase, we reduced the 15 minutes to 2 minutes. The events callbacks are expected to be delivered as soon as the threshold is reached but there are some inconsistencies with the event threshold callbacks. Sometimes the event callbacks are deferred and delivered together, sometimes the event callbacks are not delivered at all, sometimes a few event callbacks are missed etc.
0
0
60
1d