-
Notifications
You must be signed in to change notification settings - Fork 676
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
App crash on file pick in android #286
Comments
Hi, how are you picking the file? |
I am using this code void pickFile() async { |
Please, don’t use that. That’s an example code that’s made to fit a lot of use cases with a few lines and shouldn’t be used at on your project. Check the plugin’s Wiki that has a lot of well documented examples for each use case and let me know if it worked for you. Thanks! |
Now i used this code but app still crashing File extraFile = await FilePicker.getFile(type: FileType.any); Error Logs |
@maxbhoria when you run the example app, does that happen? |
|
Hum, there must be something in your project that's resulting in Also, run a full |
Plugin version is file_picker: ^1.10.0 Can you tell me how to directly use github plugin directly in my app? |
If you can't reproduce it with the example app, then likely there must be something related to some conflict on your project. There's no need to use the github project directly on your project as it won't make any difference or whatsoever, but may help you get rid of cached issues. You can give it a try. Just use it like this:
|
ok thanks, let me try this! |
it also did not worked error is same |
Yes, like I told you, pubdev has the same version. I really would like to help you, but I quite don't get what might be triggering it. Maybe post your code block that's asking for the picker. |
however it does not require any specific setting for android |
This is complete log have a look in that please D/SurfaceView(31692): windowStopped(true) false io.flutter.embedding.android.FlutterSurfaceView{9be883b V.E...... ........ 0,0-1080,2301} of ViewRootImpl@98d2c27[MainActivity] |
i tried with another new project but the output is same. Have you find anything or have you tried by creating new project to check? |
Do you remember any other settings that you did in your example because i don't how your example running perfectly |
is this the problem because of i am using kotlin and your plugin is in java?? Because i copy your android folder from the example and i paste it into my sample it worked for me |
It shouldn't have any issue with kotlin projects. But try recreating your project from scratch or run |
Hello // if (type.equals("dir") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { |
If you’re not planning to pick directories then not. I forgot to ask, what’s the minimum Android sdk of your app? |
yes of course i don't have plan to pick dir as of now but Please make a fix for this problem and my mini sdk is 21. Thanks for your support |
@maxbhoria I can’t make a fix if I don’t get what’s triggering your issue but I’ll give it a look, could you please tell me details of your app’s build gradle and which version your android device is on? |
You can check by creating a new project what wrong is triggered beacause i tried by creating new project also. I am using Andorid 10 and this is app level gradle def localProperties = new Properties() def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') apply plugin: 'com.android.application' android {
} flutter { dependencies { |
@maxbhoria if you want a quick workaround, use file_picker: 1.7.0. |
@nicolas-costa did you update it since Friday? The last update only introduced directory picks but for some reason this issue results in file type (apparently) being null where it can’t be, still trying to understand what might be resulting in it but no luck so far. |
@miguelpruivo I didn't intentionally updated it. What I can tell you is that I installed it last week to make some tests and see if it would fit my needs. I followed the docs, where, as you know, it instructs to add "file_picker: ^1.7.1". It was working perfectly. Then it stopped working somehow. I messed around trying to figure it out, without luck. Then stumbled on this version bump (1.10.0) on my pubspec file, found this issue and had the idea to rollback to 1.7. Boom, working again. So I guess the package manager updated it for me due to the: ^. |
@nikitaIndianic thanks, I'm looking into it. Does that happen only with that folder? |
i tried with nexus 5x emulator in this device i am getting crash while selection image from download folder too. |
@nikitaIndianic just tried creating a new 5x emulator with the settings you gave me and it works flawlessly. There must be something else triggering the issue. If you look into the source code, you see that the Does that happen in a brand new Flutter project? Would you mind to try please? |
yes i have tried in new project but getting same issue. |
@nikitaIndianic post your |
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.3 19D76, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) [✓] Android Studio (version 3.6) [✓] Connected device (1 available) • No issues found! |
@nikitaIndianic hum, you are in an old stable that's more than 6 months old, despite having a few earlier hotfixes (I'm currently on the latest 1.17). Would you mind trying |
i used this version bcs in latest stable version giving issue while we long press on edittext it is not giving paste option. |
@nikitaIndianic that's weird. Copy/paste is working properly for me. Let me know if it made any difference. |
yes in latest version it's working [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1) [✓] Android Studio (version 3.6) [✓] Connected device (1 available) • No issues found! |
but i am facing issue with copy/paste will you please verify once is it option working on latest stable version |
Ok, so basically this is an issue with Flutter on older versions, surprisingly. @maxbhoria would you mind upgrading Flutter to latest stable as well and see if its working for you? Thanks! |
@miguelpruivo Sure, I will try this later and update here. Thanks |
Im also facing the same issue |
read this and try |
To anyone experiencing this, please make sure you update to latest Flutter stable (currently 1.17). |
I am too facing the same issue |
Hi, try upgrade your flutter version |
Thx. It is working. |
Closing as we’ve finally found the solution. To anyone reading/experiencing this: Please update to latest Flutter stable version and it should be fixed. Thanks! |
i would like to thank to @miguelpruivo and @nikitaIndianic who finally find the reason behind this problem. Thanks |
@maxbhoria thanks for reporting, I'll refer this on the Wiki troubleshooting section as well. |
Same here bro,.. File image;
} it just keep exits,................................ V/MusicPlayerPlugin(16068): Activity Save Instance State |
@DarK-C0deR Please update to latest Flutter stable version (1.17.x) and it should be fixed. |
Tnq u Bro,... |
I am experiencing this issue on Android 8 (Galaxy A5) and 14 (emulator), getting this error after selecting a file:
|
Please help me even for me crash is happening after picking image I'm a beginner so I'm following this course but the guy who did the course did not have crash but I'm getting now idk y. Flutter 3.19.3 • channel stable I/flutter ( 7623): granted
//the below is the method for picking image
|
Hi i am not able to pick file app get crashed when i select any file.
I an using android device.
Issue printed in console
E/AndroidRuntime( 1459): java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
E/AndroidRuntime( 1459): at com.mr.flutter.plugin.filepicker.FilePickerDelegate$2.run(FilePickerDelegate.java:92)
E/AndroidRuntime( 1459): at java.lang.Thread.run(Thread.java:919)
The text was updated successfully, but these errors were encountered: