Hey Matt, thanks for the reply. Indeed, we changed from the pulling model of `pathMonitor.currentPath` to receiving updates through `pathUpdateHandler` and customers of our SDK stopped reporting the issue. I think it's ultimately gone 😉.
Post
Replies
Boosts
Views
Activity
Hello Matt,
I step across the same issue. I want to make an HTTP call to the server running in my local network. I added the NSLocalNetworkUsageDescription key both to my app target's Info.plist and my UITest target's Info.plist.
When running on physical device connected to the same network as the server: Sending the URLSession.dataTask() from the app brings the local network privacy prompt. If approved, the request is send and the approval is cached so it doesn't appear next time. All works fine - as expected.
Sending the URLSession.dataTask() from the UITest runner's XCTestCase does not bring the local network privacy prompt. The request never reaches the local server and URLSession.dataTask() results with the Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." as reported by Ejnar.
I opened a ticket in Feedback Assistant: FB8983382 (Local Network Privacy Prompt is not received from an XCTestCase)
Would love to hear Apple Engineer's reply on this.
Is there any workaround for sending local requests from UITest runner?
I'm stepping across the same problem. I already filled up bug report: FB13278576.
@eskimo Yes, Xcode 15 properly prints the warning of IPHONEOS_DEPLOYMENT_TARGET set to iOS 11 vs Xcode 15 requiring minimum iOS 12. However, because this is just a warning, I'd expect the app to run with no problem on any iOS from 12.0 to 17. Instead, it crashes when hitting any symbol from Network lib. I attached the crash report to this post.
Repro steps:
Create an Xcode 14 project, chose iOS 11 for IPHONEOS_DEPLOYMENT_TARGET. Adjust the app's startup code to build for iOS 11.
Add some code that uses the Network module, like:
import Network
if #available(iOS 12.0, *) {
_ = NWEndpoint.Host("example.com")
}
Open this project in Xcode 15.0.
Run it on device with iOS prior to 17.0.
The app will crash on NWEndpoint.Host("example.com").
Now, I understand that the problem is surfaced by following:
The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 17.0.99.
but either the severity of this message is wrong (it is a build warning, not error) or there is a problem with loading Network lib in explained setup.
We're particularly hit by this issue as a vendor lib developers. Because our library depends on Network and our customers build it from source code, we can't enforce all of them to fix their IPHONEOS_DEPLOYMENT_TARGET when migrating from Xcode 14 to Xcode 15. They ignore the warning and report the crash to us.
X14AppForOS11-2023-10-16-153400.txt