Post

Replies

Boosts

Views

Activity

xcodebuild linking error fille cannot be open()ed, errno=2
I very recently migrated our project on Swift 6. After fixing every issues, mostly due to Swift Concurrency, I’m getting the following error when compiling with Xcode 16.0, which doesn’t make any sense to me : Multiple errors: file cannot be open()ed, errno=2 path=/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/Router.o in '/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/Router.o'; file cannot be open()ed, errno=2 path=/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AccountRouter.o in '/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AccountRouter.o'; file cannot be open()ed, errno=2 path=/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AlertRouter.o in '/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AlertRouter.o'; file cannot be open()ed, errno=2 path=/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AlarmRouter.o in '/Users/.../Library/Developer/Xcode/DerivedData/MyApp-euxwyncffackymerzuntbjccezyq/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/arm64/AlarmRouter.o' (The '…’ is just me obfuscating the real name) I’ve checked the paths. The file are here and I can open them. I tried cleaning the project, removing every derived data. I removed every dependencies (cocoapods & SPM). I’m using Tuist, so I fully cleaned the project and recreated it from scratch. Then I thought it might be an issue with my Xcode installation, so I tried running the project on another machine, I still get the same error every time. Anyone has a clue on what’s happening?
11
0
620
Oct ’24
Forcing orientation on a full screen modal doesn't work on parent controller
iOS 16 introduced a new API for forcing orientation changes, which implies using the requestGeometryUpdate(_:errorHandler:). It seems that it's not working as expected when using a full screen modal. For example, let's say we have an app that locks the orientation in portrait mode except for a modally presented controller, a parent controller A and a modal controller B : A is displayed We put the device in landscape mode - A stays in portrait mode B is opened modally fullscreen from A B is displayed in landscape B has a button to go back to portrait mode using the requestGeometryUpdate(_:errorHandler:) B is dismissed through a button A ends up in landscape In the app delegate, we used supportedInterfaceOrientationsFor to force the app in portait mode except for the controller B. We tried to call setNeedsUpdateOfSupportedInterfaceOrientations every time we call requestGeometryUpdate(_:errorHandler:). We also tried to call it on the viewWillAppear from the controller A. We finally tried to call requestGeometryUpdate(_:errorHandler:) from the controller A's viewWillAppear, without any luck as well. Is this a bug in iOS 16 or are we missing something ? It seems to be working as expected when displaying the modal over the current context, but it's not what we want in this case. I can provide an example project if needed.
0
0
902
Jan ’23
List = Row task / onAppear not called each time despite it's on screen
I'm encountering a strange behaviour with List when using section and either task or onAppear. Let's say I have a list with sections and rows in each section. When I put a task to run a async task when each row appears, it doesn't call it even though it's displayed on screen. The same problem applies when using onAppear instead of task. It's easily reproducible with the given example. You can just run and scroll down to the bottom. You'll notice that the onAppear for the last row isn't called despite the row and the section is on screen. struct ContentView: View {  private var dataSource: [Int: [String]] = (0..<30).reduce([Int: [String]]()) { result, key in   var result = result   let items = (0..<4).map { "Item \($0)" }   result[key] = items   return result  }  var body: some View {   List {     ForEach(Array(dataSource.keys), id: \.self) { section in      let rows = dataSource[section]      Section {       ForEach(rows ?? [], id: \.self) { row in        let text = "\(section)-\(row)"        Text(text)         .onAppear {          print("ROW ON APPEAR \(text)")         }       }       .onAppear {        print("ON APPEAR \(section)")       }      } header: {       Text("Section \(section)")      }     }   }  } } Does anyone have an explanation ? Am I missing something ? As is my understanding of the documentation, onAppear should be called every time the view appears on screen. The interesting thing is that is seems to work fine when they're no sections.... Could it just be a bug in SwiftUI? I managed to fix this problem by using a ScrollView which embeds a LazyVStack, but by doing so I'm loosing some of the features from List, such as swipe to delete.
1
1
1.3k
Dec ’22
Xcode 14 and proxies
Hi, Many developers are working behind a company proxy and Xcode doesn't seem to pick up the system's settings (either with automatic or manual configuration). It makes it impossible to use SPM as Xcode is not able to fetch dependencies, getting very regularly the error message "No Route to host (-1)". I came across some workaround like changing the java config to use the system's settings or modifying the java exec used by Xcode to specify the proxy, but Xcode 14 doesn't seem to use java anymore (or at least I can't find where the config is located now). I also tried to set the JAVA_TOOL_OPTIONS env variable with my proxy details and with java.net.useSystemProxies=true, with no luck. Is there any way to configure the proxy within Xcode ? As anyone managed to make Xcode and SPM work behind a company proxy? I'd really appreciate some help. Thanks!
6
0
3.7k
Nov ’22
Does background app refresh have an effect on a background URLSession?
Given I have a standard background URLSession and URLSessionDownloadTask, as below (I deliberately simplified the code for the sake of the example): let sessionConfig = URLSessionConfiguration.background(withIdentifier: "mySessionID") sessionConfig.isDiscretionary = false sessionConfig.sessionSendsLaunchEvents = true self.urlSession = URLSession(configuration: sessionConfig, &amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9; delegate: self, &amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9;&amp;#9; delegateQueue: nil) let task = urlSession.downloadTask(with: url) task.resume() It seems that enabling/disabling Background App Refresh (Settings =&gt; General =&gt; Background App Refresh) changes how URLSession and its delegate behave. When background app refresh is on, the OS wakes up my app in background and call the delegate methods as described in Apple's documentation, - https://developer.apple.com/documentation/foundation/url_loading_system/downloading_files_in_the_background which allows me for example to move my downloaded file in the Photo library. When background app refresh is off, the delegate methods are never called while the app is in background. They are however called when the app the user puts the app back in foreground. The code running in both scenarios is the same, it implements URLSessionDownloadDelegate in a manager and application(_:handleEventsForBackgroundURLSession:completionHandler:) in the app delegate. I can't find any official documentation from Apple stating this is true. Background app refresh is only supposed to have an effect on the Background App Refresh API (which allows you to use background fetch and background processing). Has anyone been able to download a file in background and move it in background with Background App Refresh turned off?
1
0
1.5k
Jan ’21