You're using APIs from the iOS 14 beta that were replaced in the final release. That's why the environment value doesn't exist.
From the iOS 14 release notes: - https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-14-release-notes
The ImportFilesAction and ExportFilesAction APIs have been replaced
with a collection of new view modifiers. Use the new .fileImporter() modifier to present a system interface for
importing one or more files into your app, and the new .fileMover()
modifier to move one or more existing files to a new location. The
following is an example of a simple UI for importing and moving files: Use the new .fileExporter() modifier to present a system interface for
exporting one or more documents from your app. In this example, an app
provides a simple note-taking interface for quickly jotting down some
text and then exporting it to disk: struct QuickNote : View {
		@Binding var draft: QuickNoteDocument
		@State private var isExporting: Bool = false
		var body: some View {
				TextEditor(text: $draft.text)
						.toolbar {
								Button("Save", action: { isExporting = true })
						}
						.fileExporter(
								isPresented: $isExporting,
								document: draft,
								contentType: .plainText,
								defaultFilename: "MyNote"
						) { result in
								// Clear the draft now that it's saved.
								if case .success = result {
										draft.text = ""
								} else {
										// Handle failure.
								}
						}
		}
}
struct QuickNoteDocument : FileDocument {
		static var readableContentTypes: [UTType] { [.plainText] }
		var text: String
		init(text: String) {
				self.text = text
		}
		init(configuration: ReadConfiguration) throws {
				// Deserialize the document.
		}
		func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {
				// Serialize the document.
		}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: