Skip to content
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

The application crashes after trying to upload a file. #132

Closed
vlkonoshenko opened this issue Dec 24, 2020 · 6 comments · Fixed by #134
Closed

The application crashes after trying to upload a file. #132

vlkonoshenko opened this issue Dec 24, 2020 · 6 comments · Fixed by #134
Labels
android Android-only issues bug Something isn't working

Comments

@vlkonoshenko
Copy link

vlkonoshenko commented Dec 24, 2020

I add file in enqueue method [look screenshot]
In previous package version 2.0.0-beta3 everything work fine.

This code snippet show how I handle download process.
But I don't hit the listener breakpoints

_progressSubscription = _fileUploader.progress.listen((progress) {
      if ((progress.status == UploadTaskStatus.running &&
          progress.progress % 5 == 0) ||
          progress.status != UploadTaskStatus.running) {
        _uploadProgressController.add(UploadFileProgressEvent(
            progress.taskId, progress.status, progress.progress));
      }
    });

    _resultSubscription = _fileUploader.result.listen((result) {
      if (result.statusCode < 400) {
        _uploadStatusController.add(UploadFileStatusEvent(
            result.taskId, result.status, json.decode(result.response), false));
      } else {
        _uploadStatusController.add(UploadFileStatusEvent(
            result.taskId, result.status, null, true));
      }
    }, onError: (ex, stacktrace) {
      if (ex != null) {
        _uploadStatusController.add(UploadFileStatusEvent(
            ex.taskId,
            ex.status,
            {
              'message': ex.message,
              'code': ex.code,
              'statusCode': ex.statusCode
            },
            true));
      }
    });

Screenshot 2020-12-24 at 19 18 01

@ened
Copy link
Collaborator

ened commented Dec 24, 2020

@konoshenko can you please upload a reproducible example or share more details on what works / does not work. I can not follow the bug description 100%.

@vlkonoshenko
Copy link
Author

@ened I'll try to make an example project tomorrow. What additional details can help you?

@ened
Copy link
Collaborator

ened commented Dec 24, 2020

You mention there's a crash - so a stack trace and logs would help.

Also have you tested it using the latest beta.5 version as well?

A reproducible example would be super - it will then become part of the test suite of this project.

@vlkonoshenko
Copy link
Author

vlkonoshenko commented Dec 24, 2020

  1. Stack trace log for you. stack_trace.txt
  2. Version wich I use in screenshot. And when I switch to version: "2.0.0-beta.3" from my cache everything work fine.

Screenshot 2020-12-24 at 22 12 14

You mention there's a crash - so a stack trace and logs would help.

Also have you tested it using the latest beta.5 version as well?

A reproducible example would be super - it will then become part of the test suite of this project.

@ened ened added bug Something isn't working android Android-only issues labels Dec 24, 2020
@ened
Copy link
Collaborator

ened commented Dec 24, 2020

Ok confirmed, will fix tomorrow.

@ened ened mentioned this issue Dec 26, 2020
@ened
Copy link
Collaborator

ened commented Dec 26, 2020

@konoshenko can you try the code in #134 ?

dependency_overrides:
  flutter_uploader:
    git:
      url: https://github.com/fluttercommunity/flutter_uploader
      ref: d1c3a2acc289064a444c4f9a047135392204a178

@ened ened closed this as completed in #134 Dec 26, 2020
ened pushed a commit that referenced this issue Jan 13, 2021
* Android enqueueBinary - ensure to callback on Ui Thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Android-only issues bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants