Coder Social home page Coder Social logo

Comments (22)

miguelpruivo avatar miguelpruivo commented on May 20, 2024

Hi @ayalma are you selecting it from cloud?

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

No , i selecting it from my local storage

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

If you give it sometime, does it load the path? If it was from a cloud it would make sense because you have to give it sometime (synchronously) to cache the file. Locally, it shouldn’t be an issue.

I need you to provide more details. Post the output of your flutter doctor -v and also the steps to reproduce this issue.

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

When i'm selecting small file's the black screen not appearing
And when i'm selecting big file after giving a enough time it load file path but screen turn's to black when the caching stuff runs in app

The example application in you'r repo is reproduce the error just select big file
And for flutter output

[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.1 18B75, locale en-IR)
    • Flutter version 1.2.1 at /Users/ali/Documents/Flutter
    • Framework revision 8661d8aecd (8 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/ali/Documents/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/ali/Documents/Android/Sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] VS Code (version 1.31.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • HUAWEI MLA L11               • • android-arm64 • Android 7.0 (API 24)
    • Android SDK built for x86 64 • emulator-5554    • android-x64   • Android 7.1.1 (API 25) (emulator)

! Doctor found issues in 2 categories.

Thank you in advance

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

Well, as of now this is the correct behavior because the file needs to be fully loaded before actually accessing it, that’s why this is synchronous and you see the black screen while it’s awaiting the path to load.

Can I ask you how big the file is? Nevertheless, I may take a look into it later.

Edit: Also @ayalma, it would be great if you could post the full log of when you load a big file.

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

I tested it with file size about 300 mb
and i get this log

I/FilePicker(19909): Checking permission: android.permission.WRITE_EXTERNAL_STORAGE
I/FilePicker(19909): [SingleFilePick] File URI:content://com.android.providers.downloads.documents/document/1702
E/FilePickerUtils(19909): Getting for API 19 or abovecontent://com.android.providers.downloads.documents/document/1702
E/FilePickerUtils(19909): Document URI
E/FilePickerUtils(19909): Downloads External Document URI
E/FilePickerUtils(19909): Something went wrong while retrieving document path: java.lang.IllegalArgumentException: Unknown URI: content://downloads/public_downloads/1702
E/FilePickerUtils(19909): Something went wrong while retrieving document path: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/all_downloads/1702 from pid=19909, uid=10587 requires android.permission.ACCESS_ALL_DOWNLOADS, or grantUriPermission()
I/FilePickerUtils(19909): Remote file loaded and cached at:/data/user/0/com.sabzafzar.gss1/cache/Lynda.Scrum.Advanced_p30download.com.part2.rar
I/FilePicker(19909): Absolute file path:/data/user/0/com.sabzafzar.gss1/cache/Lynda.Scrum.Advanced_p30download.com.part2.rar
I/OpenGLRenderer(19909): Initialized EGL, version 1.4

It's somthing about permission
and i have this
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
in my manifest

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

Hi @ayalma, it has nothing to do with permission. At this point, you should be fine only with WRITE_EXTERNAL_STORAGE because I'm assuming that your app already has the INTERNET permission, if not, you may add it as well.

Nevertheless, by looking at your log I can see that it is actually caching the file (thus, creating a file of 300 MB, that's why it takes longer) probably because the device doesn't have it available locally to use. This may happen when you select file from recently used files in Android where it gives you the idea that is there, but might have been already removed by the system.

In the file picker, which folder are you selecting?

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

Hi , I have Internet permission
I'm selecting file form downloads folder
For testing purpose i cloned and tested this repo
and when i'm selecting big file there is no black screen

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@ayalma and are you getting the same path with that? As I pointed before, looks like the file is being copied locally (300 mb) so that's why it takes longer as this process is made synchronously.

Would you mind to copy that file to another local folder and select it again (from other folder, instead donwloads)? Let me know if it works.

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

The library i mentioned above act same as your lib and copy data to cache , but it cache files asynchronously i think

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@ayalma can you try to do what I've asked to?

It would help me to understand more precisely what's actually happening.

Thank you.

from flutter_file_picker.

ayalma avatar ayalma commented on May 20, 2024

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@ayalma ok, so basically, the downloads folder that you are using hasn't the file locally stored and has to download it again, that's why it takes sometime and thus the black screen.

Making it async, would mean that an user could potentially use the path without the file being yet completely loaded, which would lead to undefined behaviors (or mostly an exception).

What if you don't use await getFilePath and instead do getFilePath().then((path) => print(path));?

from flutter_file_picker.

VyasPrachi avatar VyasPrachi commented on May 20, 2024

Hello,
When I had clicked on the button there is nothing happen. Please help me out

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@VyasPrachi this is too vague. I need more info in order to help you. Is it related to this issue?

@ayalma since I don't have a reply from you, I'll close this issue in the upcoming days.

from flutter_file_picker.

VyasPrachi avatar VyasPrachi commented on May 20, 2024

Hello @miguelpruivo,
Sorry for the late reply. Photo clicked by the back camera is not taking but the photo clicked by the front camera is taken. So maybe I think this is an image size issue.

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@VyasPrachi how many issues do you have? You should move this to your own issue.

Which version are you using? This package doesn’t support picking for camera since 1.3.0.

from flutter_file_picker.

VyasPrachi avatar VyasPrachi commented on May 20, 2024

Hi @miguelpruivo,
Sorry for the trouble but I am new in flutter development. So I have asked when I am facing any problem.

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@VyasPrachi is this fixed for you?

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

@VyasPrachi what do you mean by capture? This package doesn't allow taking pictures at all. Are you talking about selecting the file?

from flutter_file_picker.

VyasPrachi avatar VyasPrachi commented on May 20, 2024

Hello @miguelpruivo,
I am talking about the plugin that is not allowed to take the file from picker but when I have given storage permission it gives access. So Now my issue is solved. Thank You for your response.

from flutter_file_picker.

miguelpruivo avatar miguelpruivo commented on May 20, 2024

Yes @VyasPrachi , you must give storage access permission.
Glad that is working now.

@ayalma feel free to reopen this if you are still experiencing any issue.

from flutter_file_picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.