Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

iOS 18 crash issue for unnecessary dequeuing
My code extension MyViewController: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView( _ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) as? CollectionViewCell { cell.setup() return cell } return UICollectionViewCell() } func collectionView( _ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath ) { // Unnecessary dequeue guard collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) is CollectionViewCell else { return } // My action for selecting cell print("Cell Selected") } } Error: *** Assertion failure in -[UICollectionView _updateVisibleCellsNow:], UICollectionView.m:5673 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]. Solution: The problem was doing unnecessary dequeuing in didSelectItemAt when selecting the cell. In previous iOS like 17 or 16 or lower, it was allowed to dequeue where it is not really needed but from iOS 18, it may restricted to unnecessary dequeuing. So better to remove dequeue and use cellForItem(at) if we need to get cell from collection view. Example extension MyViewController: UICollectionViewDelegate, UICollectionViewDataSource { func collectionView( _ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath ) -> UICollectionViewCell { if let cell = collectionView.dequeueReusableCell( withReuseIdentifier: "CollectionViewCellID", for: indexPath ) as? CollectionViewCell { cell.setup() return cell } return UICollectionViewCell() } func collectionView( _ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath ) { guard collectionView.cellForItem(at: indexPath) is CollectionViewCell else { return } // My action for selecting cell print("Cell Selected") } }
0
0
3.5k
Dec ’24
Slow bundle copy build phase from dependency
We have a dependency, Apollo iOS, that is managed by SwiftPM in an internal module Swift Package. That internal Swift Package is then linked and included in our iOS target. The iOS target has an associated WidgetKit extension app. When archiving the app, we're seeing extremely long "Copy Apollo_Apollo.bundle" build steps, on the magnitude of 15 minutes. This is only happening when copying the bundle for the Widget extension app. Builds are done with Xcode 15.2, but we've tried on 15.4 and 16.2, seeing a few minutes shaved off. How can we begin to debug this issue?
0
0
236
Dec ’24
xcodebuild: "error: …/build/Release/Defaults_Defaults.bundle: No such file or directory"
This is probably a beginner's mistake, but I can't find anything about this error anywhere, and it's completely reproducible, even on GitHub Runners and with a fresh Xcode project. The error doesn't seem to be caused by the Swift package used, Defaults, but by xcodebuild. macOS Sequoia 15.2 (24C101) Xcode Version 16.2 (16C5032a) Defaults Version 9.0.0 When following Defaults' installation instructions, building and archiving from Xcode still works fine, but building with xcodebuild always fails with this error: Copy /Users/user/DefaultsTest/build/Release/DefaultsTest.app/Contents/Resources/Defaults_Defaults.bundle /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle (in target 'DefaultsTest' from project 'DefaultsTest') cd /Users/user/DefaultsTest builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -resolve-src-symlinks /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle /Users/user/DefaultsTest/build/Release/DefaultsTest.app/Contents/Resources error: /Users/user/DefaultsTest/build/Release/Defaults_Defaults.bundle: No such file or directory (in target 'DefaultsTest' from project 'DefaultsTest') I made a fresh, reproducible Xcode project here: https://github.com/F1248/DefaultsTest And a failing GitHub Action here: https://github.com/F1248/DefaultsTest/actions/runs/12303972248/job/34340347771 Any help would be greatly appreciated.
2
0
382
Dec ’24
Crash with UITextView intelligenceCollectContent Apple Intelligence
Hello, I am using Xcode 15.3 and doesn't add any support for Apple Intelligence yet as it requires Xcode 16+. But I see many crashlogs related to Apple Intelligence, I assume crash is related to UITextView element of UIKit. Can you please help me to resolve this issue, how can I fix it? There are few lines of the crashlog, they are all similar. Thread 0 name: Thread 0 Crashed: 0 UIKitCore 0x0000000196692d74 specialized UITextView._intelligenceCollectContent(in:collector:) + 2748 (UITextView_IntelligenceSupport.swift:37) 1 UIKitCore 0x0000000196691eb0 @objc UITextView._intelligenceCollectContent(in:collector:) + 60 (<compiler-generated>:17) 2 UIIntelligenceSupport 0x000000026b91f1e4 UIIntelligenceElementCollector.performCollection(_:) + 424 (UIIntelligenceElementCollector.swift:46) 3 UIKitCore 0x0000000196473b70 specialized UIView._intelligenceElement(in:using:transformToRoot:) + 1440 (UIView_IntelligenceSupport.swift:132) 4 UIKitCore 0x000000019647a800 specialized UIView._intelligenceCollectElement(for:in:using:transformToRoot:) + 424 (UIView_IntelligenceSupport.swift:84) 5 UIKitCore 0x00000001964792ec @objc UIView._intelligenceCollectElement(for:in:using:transformToRoot:) + 136 (<compiler-generated>:77) 6 UIKitCore 0x0000000196472c20 closure #1 in UIView._intelligenceCollectSubelements(in:using:transformToRoot:) + 256 (UIView_IntelligenceSupport.swift:55) 7 UIIntelligenceSupport 0x000000026b91f728 UIIntelligenceElementCollector.performElementCollection(_:) + 424 (UIIntelligenceElementCollector.swift:61) v 8 UIKitCore 0x00000001964728f4 UIView._intelligenceCollectSubelements(in:using:transformToRoot:) + 928 (UIView_IntelligenceSupport.swift:54) 9 UIKitCore 0x0000000196473354 @objc UIView._intelligenceCollectSubelements(in:using:transformToRoot:) + 136 (<compiler-generated>:0) 10 UIKitCore 0x0000000196479810 closure #3 in UIView._intelligenceElement(in:using:transformToRoot:) + 256 (UIView_IntelligenceSupport.swift:165) 11 UIIntelligenceSupport 0x000000026b91fb54 UIIntelligenceElementCollector.performElementArrayCollection(_:) + 144 (UIIntelligenceElementCollector.swift:78) ... ... 225 UIIntelligenceSupport 0x000000026b8ee630 closure #1 in IntelligenceCollectionListener.collectFragments(_:) + 192 (IntelligenceCollectionListener.swift:60) 226 UIIntelligenceSupport 0x000000026b91b138 thunk for @escaping @callee_guaranteed () -> () + 36 227 CoreFoundation 0x000000019376b6e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (CFRunLoop.c:1818) 228 CoreFoundation 0x0000000193759910 __CFRunLoopDoBlocks + 356 (CFRunLoop.c:1860) 229 CoreFoundation 0x00000001937595f4 __CFRunLoopRun + 2432 (CFRunLoop.c:3217) 230 CoreFoundation 0x0000000193758830 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 231 GraphicsServices 0x00000001df7381c4 GSEventRunModal + 164 (GSEvent.c:2196) 232 UIKitCore 0x00000001962beeb0 -[UIApplication _run] + 816 (UIApplication.m:3844)
3
0
752
Dec ’24
Inconsistent Wallet App Behavior with Mocked Data in PKIssuerProvisioningExtensionHandler
We are implementing Apple Pay and Wallet features in our app and using mocked data for testing purposes. Specifically, in the status(completion:) method of PKIssuerProvisioningExtensionHandler, we return: passEntriesAvailable: true, remotePassEntriesAvailable: true, requiresAuthentication: true, In the passEntries(completion:) method, we provide mocked data for our card. The issue is that the app icon inconsistently appears under the "From Apps on Your iPhone" section in the Wallet app. Sometimes it shows up as expected, but other times it does not. On recent occasions, when the app is selected and mocked authorization is paased, the behavior includes a system error 'Cannot Add Card' even though we provided status that indicates that the app has available cards for Wallet. For reference: The app uses two bundle IDs supporting in-app provisioning and PNO Pass Metadata has not been configured yet. Could you help clarify the potential reasons for this inconsistent behavior?
1
1
543
Dec ’24
SwiftUI Previews not working Xcode 15 iOS 17 simulator
SwiftUI preview hangs on "Preparing iPhone Simulator for Previews". Also simulator hangs when trying to build and run. This occurred after I installed iOS 17 simulator. I tried reverting back to an iOS 16 version of the simulator, but haven't figured out how to do that. Build and run to an iPhone device works fine. Any ideas would be appreciated. Thanks.
9
4
4.2k
Dec ’24
Xcode 15 Beta Stuck on preparing iphone simulator for previews
Hiya, I am having issues trying to use previews in the xcode 15 beta, i am using an M2 macbook air with 8gb of ram. I am using MacOS Sonoma and iOS 17.0 Beta 1 and am struggling using previews, the base simulator works but no previews. I am not receiving any error so am very confused. Any help would be majorly appreciated. Thanks, Gus
6
2
4.5k
Dec ’24
SafariBookmarksSyncAgent quits unexpectedly
Since recently (maybe after updating to Sonoma 14.7.1 - 23H222, but not sure, I get a crash report stating that SafariBookmarksSyncAgent quitted unexpectedly Once acquitted the report, it will reappear 2 minutes later as long as Xcode is open. Configuration: Sonoma 14.7.1 Safari Technology Preview Release 208 (Safari 18.2, WebKit 19621.1.5.1) Xcode 15.3 (15E204a) That seems to be a known problem. Question: Is it due to MacOS version ? To Xcode version ? To Safari version ? To webKit version ? Or to simulator, as I gat an AegirPoster crash (as described here: https://stackoverflow.com/questions/77083912/macbook-pro-crashes-when-using-simulator-aegirposter-process) I read that I would need to restart some devices (eg, iPhone). That seems to temporarily solve the problem Here is a part of the report: Incident Identifier: 0D2456DF-5801-41D6-8294-2BF442224913 CrashReporter Key: 4DE33529-174E-32C5-D8A8-26FE128BE16B Hardware Model: Mac14,12 Process: SafariBookmarksSyncAgent [38972] Path: /Volumes/VOLUME/*/SafariSupport.bundle/SafariBookmarksSyncAgent Identifier: com.apple.SafariBookmarksSyncAgent Version: 8614 (8614.1.25.0.17) Code Type: ARM-64 (Native) Role: Unspecified Parent Process: launchd_sim [28070] Coalition: com.apple.CoreSimulator.SimDevice.0058D576-D9FF-4169-8437-D0A24C923500 [9832] Responsible Process: SimulatorTrampoline [1116] Date/Time: 2024-11-27 15:19:42.4908 +0100 Launch Time: 2024-11-27 15:19:42.4610 +0100 OS Version: macOS 14.7.1 (23H222) Release Type: User Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000204476580 Exception Codes: 0x0000000000000001, 0x0000000204476580 VM Region Info: 0x204476580 is not in any region. Bytes after previous region: 894002561 Bytes before following region: 58984012416 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL VM_ALLOCATE 1cefdc000-1cefe0000 [ 16K] r--/rwx SM=PRV ---> GAP OF 0xdf1020000 BYTES commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=COW reserved VM address space (unallocated) Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [38972] Triggered by Thread: 0 Thread 0 Crashed: 0 dyld_sim 0x104f9dc7c dyld4::SyscallDelegate::forEachInDirectory(char const*, bool, void (char const*, char const*) block_pointer) const + 172 1 dyld_sim 0x104f88b6c invocation function for block in dyld4::ProcessConfig::PathOverrides::processVersionedPaths(dyld4::ProcessConfig::Process const&, dyld4::SyscallDelegate&, dyld4::ProcessConfig::DyldCache const&, dyld3::Platform, dyld3::GradedArchs const&, lsl::Allocator&) + 104 2 dyld_sim 0x104f88aa0 dyld4::ProcessConfig::PathOverrides::forEachInColonList(char const*, char const*, bool&, void (char const*, bool&) block_pointer) + 224 3 dyld_sim 0x104f886b8 dyld4::ProcessConfig::PathOverrides::processVersionedPaths(dyld4::ProcessConfig::Process const&, dyld4::SyscallDelegate&, dyld4::ProcessConfig::DyldCache const&, dyld3::Platform, dyld3::GradedArchs const&, lsl::Allocator&) + 144 4 dyld_sim 0x104f882a8 dyld4::ProcessConfig::PathOverrides::PathOverrides(dyld4::ProcessConfig::Process const&, dyld4::ProcessConfig::Security const&, dyld4::ProcessConfig::Logging const&, dyld4::ProcessConfig::DyldCache const&, dyld4::SyscallDelegate&, lsl::Allocator&) + 344 5 dyld_sim 0x104f868b8 dyld4::ProcessConfig::ProcessConfig(dyld4::KernelArgs const*, dyld4::SyscallDelegate&, lsl::Allocator&) + 152 6 dyld_sim 0x104f85e30 _dyld_sim_prepare + 352 7 dyld 0x10492fa8c dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1276 8 dyld 0x10492e4f0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 308 9 dyld 0x10492def4 start + 1868 I filed a bug report: Nov 27, 2024 at 3:41 PM – FB15976427
1
0
618
Dec ’24
Xcode 15 breakpoints not stopping on symbolicated code
I've recently installed Xcode Version 15.0 (15A240d) and when I set a breakpoint it doesn't stop on the line of code where the breakpoint is set. Rather, it opens another window with the hex code. If I press F6 it doesn't highlight the next line of code, but I can see that it moved because the variables are changing. Is this a known bug? I have tried all the usual stuff like deleting derived data and restarting everything. I have even deleted com.apple.dt.Xcode directory in ~/Library/Caches. to set things back to the defaults. The only thing I haven't done yet is reinstall Xcode. Unfortunately, this is very bad timing as I need to get my app finished for the iOS17 and WatchOS 10 release.
9
5
7.3k
Dec ’24
Updating Swift Packages via command line (Xcode 16)
We have a tool in our CI which periodically updates our iOS project's Swift Package Manager dependencies. The script that does a few things, but generally speaking it first removes the existing package.resolved at ./ProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved and then runs: xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache This regenerated the package.resolved file to reflect the latest, updated versions of the dependencies. It is the equivalent of doing Xcode > File > Packages> Update to Latest Package Versions. This has been working perfectly for a long time, but has stopped working since we moved from Xcode 15.4 to Xcode 16. I have also tested this with Xcode 16.1 and 16.2 - with no luck. I have tried running this command locally, and can confirm it is not an issue with the environment of our CI. I have also tried swift package update. Both of these commands appear to work - no errors are thrown, and the logs say "resolved source packages". However, they are not updating the packages. They are making no changes to the package.resolved file. However, using Xcode > File > Packages> Update to Latest Package Versions in Xcode 16 works as expected - the packages are updated and the .resolved file is updated. Is there now a different way to update Swift packages via the command line, or is this likely an Xcode 16 bug? Update: This feels broken, so I have submitted a Feedback Report (FB16108036) but perhaps someone can suggest a workaround for the time being!
0
3
843
Dec ’24
Building Issue
Hello, I am very new to programming with Xcode. I’ve been searching the forums and online but can’t seem to find an answer. My project is not displaying the triangle build button in the left corner, nor the status of the build. No issues with my code are apparent, yet it does not build and preview when I push build and clean in the product tab
1
0
249
Dec ’24
How to implement Picture-in-Picture (PiP) in Flutter for iOS using LiveKit without a video URL?
I am building a video conferencing app using LiveKit in Flutter and want to implement Picture-in-Picture (PiP) mode on iOS. My goal is to display a view showing the speaker's initials or avatar during PiP mode. I successfully implemented this functionality on Android but am struggling to achieve it on iOS. I am using a MethodChannel to communicate with the native iOS code. Here's the Flutter-side code: import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; class PipController { static const _channel = MethodChannel('pip_channel'); static Future<void> startPiP() async { try { await _channel.invokeMethod('enterPiP'); } catch (e) { if (kDebugMode) { print("Error starting PiP: $e"); } } } static Future<void> stopPiP() async { try { await _channel.invokeMethod('exitPiP'); } catch (e) { if (kDebugMode) { print("Error stopping PiP: $e"); } } } } On the iOS side, I am using AVPictureInPictureController. Since it requires an AVPlayerLayer, I had to include a dummy video URL to initialize the AVPlayer. However, this results in the dummy video’s audio playing in the background, but no view is displayed in PiP mode. Here’s my iOS code: import Flutter import UIKit import AVKit @main @objc class AppDelegate: FlutterAppDelegate { var pipController: AVPictureInPictureController? var playerLayer: AVPlayerLayer? override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let controller: FlutterViewController = window?.rootViewController as! FlutterViewController let pipChannel = FlutterMethodChannel(name: "pip_channel", binaryMessenger: controller.binaryMessenger) pipChannel.setMethodCallHandler { [weak self] (call: FlutterMethodCall, result: @escaping FlutterResult) in if call.method == "enterPiP" { self?.startPictureInPicture(result: result) } else if call.method == "exitPiP" { self?.stopPictureInPicture(result: result) } else { result(FlutterMethodNotImplemented) } } GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } private func startPictureInPicture(result: @escaping FlutterResult) { guard AVPictureInPictureController.isPictureInPictureSupported() else { result(FlutterError(code: "UNSUPPORTED", message: "PiP is not supported on this device.", details: nil)) return } // Set up the AVPlayer let player = AVPlayer(url: URL(string: "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4")!) let playerLayer = AVPlayerLayer(player: player) self.playerLayer = playerLayer // Create a dummy view let dummyView = UIView(frame: CGRect(x: 0, y: 0, width: 1, height: 1)) dummyView.isHidden = true window?.rootViewController?.view.addSubview(dummyView) dummyView.layer.addSublayer(playerLayer) playerLayer.frame = dummyView.bounds // Initialize PiP Controller pipController = AVPictureInPictureController(playerLayer: playerLayer) pipController?.delegate = self // Start playback and PiP player.play() pipController?.startPictureInPicture() print("Picture-in-Picture started") result(nil) } private func stopPictureInPicture(result: @escaping FlutterResult) { guard let pipController = pipController, pipController.isPictureInPictureActive else { result(FlutterError(code: "NOT_ACTIVE", message: "PiP is not currently active.", details: nil)) return } pipController.stopPictureInPicture() playerLayer = nil self.pipController = nil result(nil) } } extension AppDelegate: AVPictureInPictureControllerDelegate { func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { print("PiP started") } func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) { print("PiP stopped") } } Questions: How can I implement PiP mode on iOS without using a video URL (or AVPlayerLayer)? Is there a way to display a custom UIView (like a speaker’s initials or an avatar) in PiP mode instead of requiring a video? Why does PiP not display any view, even though the dummy video URL is playing in the background? I am new to iOS development and would greatly appreciate any guidance or alternative approaches to achieve this functionality. Thank you!
1
0
692
Dec ’24
Help needed to understand the issues from the app
Hi, There are total three errors from the app running on the device. First one is right after the app starts running on the device: Could not create a sandbox extension for '/var/containers/Bundle/Application/D4CBF093-EFB1-43C5-996D-7D5CB04BF643/appadmob.app' Below second issue comes when I dismiss the Interstitial Ad First responder issue detected: non-key window attempting reload - allowing due to manual keyboard (first responder window is <UIWindow: 0x10d11c700; frame = (0 0; 414 896); hidden = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x301749300>; backgroundColor = <UIDynamicSystemColor: 0x3002b3080; name = _windowBackgroundColor>; layer = <UIWindowLayer: 0x3019b7960>>, key window is <QUIWindow: 0x10880db00; baseClass = UIWindow; frame = (0 0; 414 896); gestureRecognizers = <NSArray: 0x3017276e0>; layer = <UIWindowLayer: 0x3019852f0>>) And the third issue below follows right after the second one: Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))" UserInfo={NSLocalizedFailureReason=((target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.rendering AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.networking AND target is not running or doesn't have entitlement com.apple.developer.web-browser-engine.webcontent))}> 0x118024480 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=19180, error: (null) Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x3019254a0 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}} Also when I dismissed the interstitial ad, the screen looks greyed out, but when I touch the screen, the screen comes to normal. Could you please suggest any solution for the problems. Thanks,
2
0
2.8k
Dec ’24
Xcode 16: SwiftUI plain Button & UIButton not working
It looks like Xcode 16 has changed this behavior so I'm not sure if this is a bug or not. When a SwiftUI Button wraps a UIButton, the button doesn't work on iOS 18.0+ import SwiftUI struct ContentView: View { var body: some View { VStack { Button(action: { print("Not called on iOS 18") }) { WrapperButton() .frame(width: 200, height: 50) } } } } struct WrapperButton: UIViewRepresentable { func makeUIView(context: Context) -> some UIView { let button = UIButton(type: .system) button.setTitle("OK", for: .normal) return button } func updateUIView(_ uiView: UIViewType, context: Context) {} } This occurs with the app build with Xcode 16 and running on iOS 18 but it was worked with Xcode 15 builds and running on iOS 18
1
0
541
Dec ’24
Xcode 16 Organizer Failed to Download Report's Stack Trace
I am currently investigating an issue with my app's slow launch time in Xcode 16. However, when I open the Launches pane in the Xcode Organizer, I can only see the report list, but I encounter an error message like the one below in the stack trace. This issue also occurs in the Disk Writes, Energy, and Hangs panes, but not in the Crashes pane. Can someone advise me on what steps I should take? Any help would be greatly appreciated.
1
0
476
Dec ’24
Xcode 16 Minimum Deployments value Not Saving
Dear Apple Developer Support, I’m reporting an issue in Xcode 16 where the iOS minimum Deployments value in the Targets General tab resets to blank when set below iOS 15.6. This issue does not occur when setting the target through Build Settings, where it’s retained correctly. Steps to Reproduce: Set the minimum Deployments value to below 15.6 in General > minimum Deployments. Save and close the project. Reopen the project and check the target in General — it’s blank. Workarounds Tried: Tested on Xcode 16, 16.1, and 16.2. Manually set the target every time. Set the target via Build Settings (works but is inconvenient). System Info: Xcode: 16.2 macOS: 14.5 This impacts my workflow as my project targets iOS 13. Please investigate and advise. Please check the attached screenshots Thanks and Regards, Pavan
2
2
983
Dec ’24
XCode 16 clang++ compiler generates unexpected results for conditional checks at -O2 and -O3 optimization levels
Around a month back, developers of the OpenJDK project, when using XCode 16 to build the JDK started noticing odd failures when executing code which was compiled using the clang++ compiler shipped in that XCode 16 release (details in https://bugs.openjdk.org/browse/JDK-8340341). Specifically, a trivial for loop in a c++ code of the form: int limit = ... // method local variable for (i=0; i<limit; i++) { ... } ends up iterating more times than the specified limit. The "i<limit" returns true even when it should have returned false. In fact, debug log messages within the for loop of the form: fprintf(stderr, "parsing %d of %d, %d < % d == %s", i, limit, i, limit, (i<limit) ? "true" : "false"); would show output of the form: parsing 0 of 2, 0 < 2 == true parsing 1 of 2, 1 < 2 == true parsing 2 of 2, 2 < 2 == true Notice, how it entered the for loop even when 2 < 2 should have prevented it from entering it. Furthermore, notice the message says 2 < 2 == true (which clearly isn't right). This happens when that code is compiled with optimization level -O2 or -O3. The issue doesn't happen with -O1. I had reported this as an issue to Apple through feedback assistance, more than a month back. The feedback id is FB15162411. There hasn't been any response to it nor any indication that the issue has been noticed and can be reproduced (the steps to reproduce have been provided in that issue). In the meantime, more and more users are now running into this failure in JDK when using XCode 16. We haven't put any workaround in place (the only workaround we know of is using -O1 for the compilation of this file) because it isn't clear what exactly is causing this issue (other than the fact that it shows up with specific optimization levels). It's also unknown if this bug has wider impact. Would it be possible to check if FB15162411 is being looked into and any technical details on what's causing this? That would help us decide if it's OK to put in place a temporary workaround in the OpenJDK build and how long to maintain that workaround. For reference, this was reproduced on: clang++ --version Apple clang version 16.0.0 (clang-1600.0.26.3) Target: arm64-apple-darwin23.6.0 Thread model: posix InstalledDir: /xcode-16/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
13
1
1.9k
Dec ’24