Hello Friends
I am currently developing a framework that offers a SwiftUI menu among other things. In this menu I use a normal FileImporter.
import SwiftUI
import UIKit
import UniformTypeIdentifiers
struct SimulatorConnectionView: View {
@State private var isImporting: Bool = false
@State private var fileSelected: Bool = false
@State private var filename: String = "Select File"
@State private var url: URL = URL(string: "/")!
var body: some View {
VStack{
// some code
HStack {
StandardButton(title: filename, width: 250, locked: false, action: {
isImporting = true
})
}
// some code
}.fileImporter(
isPresented: $isImporting,
allowedContentTypes: [UTType.text],
allowsMultipleSelection: false
) { result in
do {
guard let selectedFile: URL = try result.get().first else { return }
url = selectedFile
fileSelected = true
filename = selectedFile.lastPathComponent
} catch {
// Handle failure.
print(error.localizedDescription)
}
}
}
}
I’m using XCode 14.3.1 and I’m building for an iPad Air (4. Gen) with iOS 16.2
When I now run the application that uses the framework and open the FileImporter, the standart window opens. But after a certain time, it starts to flicker and eventually crashes. The following Error Message occurs:
2023-08-29 09:36:37.652586+0200 “MyApplication” [2161:397002] [lifecycle] [u 8130AA3A-2C68-4F54-91D0-9CA032B2644F:m (null)] [com.apple.DocumentManagerUICore.Service(1.0)] Connection to plugin interrupted while in use.
2023-08-29 09:36:37.654256+0200 “MyApplication” [2161:397002] [lifecycle] [u 8130AA3A-2C68-4F54-91D0-9CA032B2644F:m (null)] [com.apple.DocumentManagerUICore.Service(1.0)] Connection to plugin invalidated while in use.
2023-08-29 09:36:37.663598+0200 “MyApplication” [2161:396793] [DocumentManager] The view service did terminate with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
2023-08-29 09:36:37.663672+0200 “MyApplication” [2161:396793] [DocumentManager] Remote view controller crashed with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}. Trying to relaunch.
2023-08-29 09:36:37.668171+0200 “MyApplication” [2161:397042] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process does not exist" UserInfo={NSLocalizedFailureReason=Specified target process does not exist}>
Unfortunately, I’ve no idea what this messages want to tell me and google couldn’t help me ether so far. Has maybe someone an idea what the problem could be or can give me at least a hint in which direction I have to search?
Kind regards