-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"@UiThread must be executed on the main thread" exception while uploading to SFTP server #15
Comments
Same issue here, any workaround ? |
After some digging, I found out that the file was actually successfully uploaded, despite the error. Fortunately I found a workaround :
To this : It removes the progress handler, which is sad, but then it works fine :) |
@Nico04 , your changes will not allow progress of upload or download to be seen. Please try sjagat@9e10957 patch. I did tried and it works. @shaqian , Please use above patch if you agree. I did validate it and it does work. |
@sjagat solution worked for me. Thank you. |
@sjagat your patch worked for me also, thanks :) |
Could this patch get pushed to master soon? @sjagat. It works for me too! |
Thanks @sjagat and sorry for the delay. The fix for eventSink is released in v0.05. Thanks, |
@shaqian Great !!! Thank you. Will try out soon .... |
Archiving the thread. Feel free to reopen if the issue persists. Thanks, |
I tried to upload a file but after successfull connect and connectSFTP I got a strange exception while trying to sftpUpload. I found info that many plugins had such issue and needed a fix.
E/SshPlugin(26101): Failed to upload /data/user/0/com.example.picker/app_flutter/file0.jpg
E/flutter (26101): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(upload_failure, java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Thread-8, null)
E/flutter (26101): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (26101): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
E/flutter (26101):
E/flutter (26101): #2 SSHClient.sftpUpload (package:ssh/ssh.dart:185:33)
E/flutter (26101):
E/flutter (26101): #3 MyApp.sendPhotos (package:picker/main.dart:126:24)
E/flutter (26101):
E/flutter (26101): #4 MyApp.build. (package:picker/main.dart:74:22)
E/flutter (26101): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14)
E/flutter (26101): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:711:32)
E/flutter (26101): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (26101): #8 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
E/flutter (26101): #9 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)
E/flutter (26101): #10 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)
E/flutter (26101): #11 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)
E/flutter (26101): #12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)
E/flutter (26101): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (26101): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (26101): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
binding.dart:102:7)
E/flutter (26101): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gesturesE/flutter (26101): #18 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (26101): #19 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (26101): #21 _invoke1 (dart:ui/hooks.dart:250:10)
The text was updated successfully, but these errors were encountered: