Fix errordomain=nscocoaerrordomain&errormessage

errordomain=nscocoaerrordomain&errormessage=The specified shortcut could not be found.&errorcode=4 could not complete the action. (officeimporterrordomain error 912.).Fix officeimporterrordomain 912 on iphone .office import error domain 912 or also known as office error 912, Officeimporterrordomain 912 error on iphone- cannot open word excel files in Gmail on both iOS 11 and iOS12.(Fix office import error domain 912, OfficeImportErrorDomain error 912). These are errors that currently have no specific cause. It is believed to be due to the Gmail App.

Hướng dẫn sửa lỗi officeimporterrordomain 912 trên iphone
Hướng dẫn sửa lỗi officeimporterrordomain 912 trên iphone

 

Hướng dẫn sửa lỗi officeimporterrordomain 912 trên iphone

OfficeImportErrorDomain 912 error occurs when your device has difficulty opening or processing an Office file, usually because the file is too large, incompatible with the version of Office you are using, or an error occurred while downloading/unzipping the file. To fix this, you can unzip the file on your computer, update the Office application to the latest version, or use the web version to open the file.
Main causes of OfficeImportErrorDomain 912 error:
Large file size:
The Word, Excel, or PowerPoint document file is too large for the device to unzip or process.
Format incompatibility:
The file is in a new or complex format that is not supported by the version of Office on your phone.
File download error:
The file download from email or cloud service was interrupted or failed.
Decompression error:
The file is damaged or not properly decompressed. How to fix OfficeImportErrorDomain 912 error:
1. Unzip the file on your computer:
Instead of uploading the file directly to your phone, try unzipping the file on your computer and then sending the unzipped file back to you.
2. Update Office apps:
Check and update the Office apps (Word, Excel, PowerPoint) on your iPhone to the latest version to ensure compatibility with new file formats.
3. Use the web version:
If you are using Google Classroom or similar services, try opening the file directly on the web version via your browser instead of the mobile app.
4. Double-check the file:
Try re-uploading the file or asking the sender to resend the file to eliminate the possibility of a corrupted file

Lỗi này hiện vẫn chưa khắc phục được nguyên nhân cụ thể kể cả update Gmail lẫn iOS mới nhất. Hiện tượng là các file office có file mở được có file không mở được trong Gmail, nhất là các File quá nặng.

Cách 1: Sử dụng tiện ích Mail của iPhone để đăng nhập tài khoản Gmail

Trên iPhone có sẵn một ứng dụng đọc email đó là Mail, bạn hoàn toàn có thể đăng nhập Gmail của mình vào và sử dụng, bạn sẽ dễ dàng mở tài liệu Word, Excel lên mà không gặp lỗi lầm nào cả.

Sử dụng tiện ích Mail của iPhone để đăng nhập tài khoản Gmail
Sử dụng tiện ích Mail của iPhone để đăng nhập tài khoản Gmail

Đầu tiên bạn mở danh sách ứng dụng của iPhone, tìm một ứng dụng hình lá thư có chữ Mail ở dưới, sau đó bạn chạm vào để mở ứng dụng lên:

  • Chọn google để tiếp tục thêm vào tài khoản gmail vào app Email trên điện thoại iphone  

  • Khi nhấp vào mục Google, trên màn hình sẽ đưa bạn đến trang đăng nhập của Google. Sau đó, bạn hãy điền thông tin đầy đủ ( tên đăng nhập email/mật khẩu). 

  • Khi quá trình đăng nhập thành công, màn hình điện thoại xuất hiện cửa sổ mới để người dùng đồng bộ hóa

  • Nhấn lưu để tài liệu trong hộp thư tải về gmail

Cách 2: Mở tài liệu lỗi OfficeImportErrorDomain 912 trên iPhone thông qua Google Drive

Google Drive là một trong  những dịch vụ lưu trữ và đồng bộ hóa tập tin được tạo bởi Google. Ứng dụng này giúp người dùng có thể lưu trữ tập tin trên đám mây. Hoặc chia sẻ tập tin và chỉnh sửa tài liệu, văn bản, bảng tính…đến nhiều người cùng lúc. 

Do đó, nếu điện thoại của bạn đang gặp phải lỗi officeimporterrordomain 912 thì không nên bỏ qua cách khắc phục này. Các thao tác để mở tài liệu lần lượt là: 

  • Mở tài liệu từ email, khi gặp thông báo không hoàn tất tác vụ thì bạn hãy nhấn vào biểu tượng Google Drive ( tài liệu Word, Excel sự tự động được chuyển vào Google Drive) 

  • Mở ứng dụng Google Drive, chọn file tài liệu mới chuyển sang 

Có thể nói, đây là cách sửa lỗi officeimporterrordomain 912 trên iphone đơn giản nhất. Ước lượng thời gian thực hiện chuyển đổi tài liệu chưa đến 1 phút. Điều này giúp người dùng có thể nhanh chóng đọc được tệp tài liệu của mình. 

Cách 3: Các bạn dùng ứng dụng của bên thứ 3 để khắc phục lỗi này.

Step 1- Go to appstore
Step 2- Find an application to open word or excel files like Google doc or Document
I vote for Document application here:
https://itunes.apple.com/us/app/documents-office-docs/id306273816?mt=8
(And there are many other apps that can open it – please note)
Install it and open the file with the above 2 parts

errordomain=nscocoaerrordomain&errormessage=không thể tìm thấy phím tắt được chỉ định.&errorcode=4

Hello, I’m trying to save some Strings in a csv document:

        var tempString = String()
        for Rezept in alleRezepte {
            tempString += "\(Rezept.name), \(Rezept.description), \(Rezept.nutrients), \(Rezept.whatToDo)\n"
        }
        let dirs = (NSSearchPathForDirectoriesInDomains(.documentDirectory, .allDomainsMask, true) as? [String])
        let path = dirs?[0].appending("rezepte.csv")
        let url = URL(string: path!)
        do {
            try tempString.write(to: url!, atomically: true, encoding: String.Encoding.utf8)
        } catch {
            print(error)
        }
        print("Daten gesichert")

And I get this error:

CFURLCopyResourcePropertyForKey failed because it was passed an URL which has no scheme

Error Domain=NSCocoaErrorDomain Code=518 “The file couldn’t be saved because the specified URL type isn’t supported.”

How can I fix this?

Thank you for helping.

Fix:

At the very least, you have a problem in line 6, because you are not ensuring there is a “/” separator between path components. There may also be an issue with a returned path starting with a “~”. If it isn’t one of those things, then print out the path to see what’s wrong with it.

However, the larger issue is that you should stop using path strings at all. There is a FileManager method “urls(for:in:)” that returns URLs directly, and can you the URL addPathComponent method to build the final URL properly.

(It’s not that you can’t use paths, just that URLs are always preferred these days.)

Thông báo lỗi “không thể đọc dữ liệu vì không đúng định dạng” trong Swift thường chỉ ra rằng có vấn đề với cách bạn đang cố gắng giải mã hoặc đọc dữ liệu, thường là từ phản hồi JSON hoặc tệp. Sau đây là một số lý do phổ biến gây ra lỗi này và cách khắc phục:

  1. Định dạng dữ liệu không đúng :
    – Đảm bảo rằng dữ liệu bạn đang cố giải mã thực sự ở định dạng mong muốn (ví dụ: JSON). Nếu bạn đang truy xuất dữ liệu từ API, hãy kiểm tra phản hồi API bằng công cụ như Postman hoặc cURL.
  2. Cấu trúc mô hình không khớp :
    – Nếu bạn đang sử dụng Codableđể giải mã JSON, hãy đảm bảo rằng cấu trúc mô hình của bạn khớp với cấu trúc JSON. Ví dụ, tên thuộc tính phải khớp với các khóa trong JSON và các loại phải khớp nhau.
  • nhanh 
  • struct MyModel: Codable { 
  • cho id: Int 
  • hãy đặt tên: Chuỗi 
  1. Giá trị tùy chọn :
    – Nếu JSON của bạn chứa các trường tùy chọn, hãy đảm bảo khai báo chúng là tùy chọn trong mô hình của bạn. Nếu khóa bị thiếu trong JSON và mô hình của bạn mong đợi một loại không tùy chọn, điều này sẽ gây ra lỗi giải mã.
  2. Mã hóa dữ liệu :
    – Nếu bạn đang tạo dữ liệu JSON theo cách thủ công, hãy đảm bảo dữ liệu được định dạng đúng. Sử dụng JSONSerializationđể xác thực cấu trúc JSON trước khi giải mã.
  3. Xử lý lỗi :
    – Đảm bảo thực hiện xử lý lỗi đúng cách khi giải mã. Điều này có thể cung cấp cho bạn nhiều bối cảnh hơn về những gì đã xảy ra sai.
  • nhanh 
  • LÀM { 
  • hãy để decodedData = thử JSONDecoder().decode(MyModel.self, từ: dữ liệu) 
  • } nắm lấy { 
  • print(“Lỗi giải mã: \(lỗi)”) 
  1. Mã hóa ký tự :
    – Nếu dữ liệu được đọc từ tệp hoặc yêu cầu mạng, hãy đảm bảo sử dụng mã hóa ký tự chính xác. UTF-8 là mã hóa phổ biến nhất cho JSON.
  2. Gỡ lỗi :
    – In dữ liệu thô trước khi giải mã để xem nó trông như thế nào. Điều này có thể giúp xác định các vấn đề về định dạng.
  • nhanh 
  • nếu để jsonString = String(dữ liệu: dữ liệu, mã hóa: .utf8) { 
  • in(“Chuỗi JSON: \(jsonString)”) 

Đoạn mã ví dụ

Sau đây là một ví dụ đơn giản về giải mã JSON trong Swift:

  • struct MyModel: Codable { 
  • cho id: Int 
  • hãy đặt tên: Chuỗi 
  •  
  • hãy để jsonData = “”” 
  • “mã số”: 1, 
  • “tên”: “Ví dụ” 
  • “””.dữ liệu(sử dụng: .utf8)! 
  •  
  • LÀM { 
  • hãy để decodedModel = thử JSONDecoder().decode(MyModel.self, từ: jsonData) 
  • in(mô hình giải mã) 
  • } nắm lấy { 
  • print(“Lỗi giải mã: \(lỗi)”) 

Bằng cách làm theo các bước này, bạn sẽ có thể xác định và giải quyết vấn đề gây ra lỗi. Nếu bạn vẫn gặp sự cố, vui lòng cung cấp thêm thông tin chi tiết về mã và dữ liệu bạn đang xử lý để được hỗ trợ thêm.

Sponsored Links: