deansyd / icloud_storage

A flutter plugin for uploading and downloading files to and from iCloud
MIT License
40 stars 24 forks source link

flutter: Upload File Progress: 95.0 #24

Closed wwcom227 closed 1 year ago

wwcom227 commented 1 year ago

the file has been uploaded successfully, but the progress can reach 95% at most, and onDone cannot be triggered

the question happens on my iphone14pro

mdynia111 commented 1 year ago

do you have iOS 16? I'm facing the same problem.

wwcom227 commented 1 year ago

do you have iOS 16? I'm facing the same problem.

yes

deansyd commented 1 year ago

Could you please clarify what the issue is? Is it:

  1. The file got uploaded, but the library isn't reporting completion (onDone not triggered); or
  2. The file got uploaded at 95% only. If it is the 2nd case, have you checked whether you have enough storage on the phone? What is the size of the file you are uploading?
mdynia111 commented 1 year ago

it's the 2 case, it stops at 95% and file is not displayed in iCloud storage

wwcom227 commented 1 year ago

I am in the first case, the file has been uploaded to iCloud, but the progress has been stuck at 95%

deansyd commented 1 year ago

@wwcom227, I tested this on an iPhone 14 Pro simulator with iOS 16.0. I can't reproduce the issue. You said you were testing it on a physical device? Have you tried it on a simulator? Do you have the same issue on the simulator?

deansyd commented 1 year ago

it's the 2 case, it stops at 95% and file is not displayed in iCloud storage

@mdynia111, are you testing it on a simulator? If so, resetting the simulator can fix the issue.

mdynia111 commented 1 year ago

no, not really, the same issue happens on multiple physical devices

deansyd commented 1 year ago

Are they all on iOS 16?

deansyd commented 1 year ago

Please try this PR to see whether it can fix the issue https://github.com/deansyd/icloud_storage/pull/25

wwcom227 commented 1 year ago

@wwcom227, I tested this on an iPhone 14 Pro simulator with iOS 16.0. I can't reproduce the issue. You said you were testing it on a physical device? Have you tried it on a simulator? Do you have the same issue on the simulator?

I tested that there is no problem on the simulator, and not all iOS16.0 iPhone 14 Pro physical devices have problems. This problem was reported by one of my users, and I see that it must appear here.

wwcom227 commented 1 year ago

Please try this PR to see whether it can fix the issue #25

ok, let me try first

wwcom227 commented 1 year ago

Please try this PR to see whether it can fix the issue #25

problem still exists.

mdynia111 commented 1 year ago

the same for me, file never gets uploaded

deansyd commented 1 year ago

Please provide the following info:

  1. Code snippet where you've used the 'upload' api.
  2. Screenshot of the error
  3. The size of the file you tried to upload
  4. The available storage capacity on your icloud
mdynia111 commented 1 year ago

1 It happens even with your example code: https://github.com/deansyd/icloud_storage/blob/master/example/lib/upload.dart 2 There is no error for me, it properly reaches 95% and gets stuck at that 3 File size is around 125 KB 4 iCloud storage plan - 200 GB (140 GB is used)

deansyd commented 1 year ago

This is most likely to be an issue with iOS. The upload simply calls the native code FileManager.default.copyItem(at: localFileURL, to: cloudFileURL). And only a small sets of devices have this issue. I suggest you do the following:

  1. Update the package to the latest version 2.2.0. This version fixes an issue where the upload/download error were not being passed back to the flutter code. You may receive a platform error if the upload isn't successful.
  2. If you don't receive any error and the upload is still stuck, you may want to try some of the suggestions in the links below: https://www.tenorshare.com/icloud-tips/how-to-fix-icloud-upload-stuck.html https://apple.stackexchange.com/questions/380370/icloud-uploading-stuck-does-anyone-know-why-it-actually-does-this