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

Crashes if other file manager is selected #39

Closed
bradyt opened this issue Feb 23, 2019 · 2 comments
Closed

Crashes if other file manager is selected #39

bradyt opened this issue Feb 23, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@bradyt
Copy link

bradyt commented Feb 23, 2019

I'm working in the android emulator, I have Simple File Manager installed from F-Droid, and if I try to select a file from there, my app crashes.

Here is a screenshot of the File Manager selector being on left.

So if I select say Documents/cone/.cone.ledger.txt, the app crashes. Here are the some of the lines I find in flutter run.

(In particular the issue seems to be that the file manager is returning URI:content://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Documents/cone/.cone.ledger.txt.)

I/SimplePermission(11587): Checking permission : android.permission.WRITE_EXTERNAL_STORAGE
I/FilePicker(11587): Custom file type: text/plain
I/FilePicker(11587): Checking permission: android.permission.WRITE_EXTERNAL_STORAGE
D/FilePicker(11587): Intent: Intent { act=android.intent.action.GET_CONTENT cat=[android.intent.category.OPENABLE] typ=text/plain }
D/EGL_emulation(11587): eglMakeCurrent: 0xdef056c0: ver 3 0 (tinfo 0xdef03fa0)
I/FilePicker(11587): URI:content://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Documents/cone/.cone.ledger.txt
E/FilePathPicker(11587): +++ API 19 URI :: content://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Documents/cone/.cone.ledger.txt
E/FilePathPicker(11587): +++ No DOCUMENT URI :: CONTENT 
D/AndroidRuntime(11587): Shutting down VM
E/AndroidRuntime(11587): FATAL EXCEPTION: main
E/AndroidRuntime(11587): Process: info.tangential.cone, PID: 11587
E/AndroidRuntime(11587): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=95162922, result=-1, data=Intent { dat=content://com.simplemobiletools.filemanager.pro.provider/external_files/storage/emulated/0/Documents/cone/.cone.ledger.txt typ=text/plain flg=0x1 }} to activity {info.tangential.cone/info.tangential.cone.MainActivity}: java.lang.IllegalArgumentException: column '_data' does not exist. Available columns: []
E/AndroidRuntime(11587): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4360)
E/AndroidRuntime(11587): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4402)
E/AndroidRuntime(11587): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
E/AndroidRuntime(11587): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(11587): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(11587): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/AndroidRuntime(11587): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(11587): 	at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(11587): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(11587): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(11587): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(11587): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(11587): Caused by: java.lang.IllegalArgumentException: column '_data' does not exist. Available columns: []
E/AndroidRuntime(11587): 	at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:340)
E/AndroidRuntime(11587): 	at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:87)
E/AndroidRuntime(11587): 	at com.mr.flutter.plugin.filepicker.FileUtils.getDataColumn(FileUtils.java:129)
E/AndroidRuntime(11587): 	at com.mr.flutter.plugin.filepicker.FileUtils.getForApi19(FileUtils.java:110)
E/AndroidRuntime(11587): 	at com.mr.flutter.plugin.filepicker.FileUtils.getPath(FileUtils.java:27)
E/AndroidRuntime(11587): 	at com.mr.flutter.plugin.filepicker.FilePickerPlugin$1.onActivityResult(FilePickerPlugin.java:55)
E/AndroidRuntime(11587): 	at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:210)
E/AndroidRuntime(11587): 	at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:139)
E/AndroidRuntime(11587): 	at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:138)
E/AndroidRuntime(11587): 	at android.app.Activity.dispatchActivityResult(Activity.java:7454)
E/AndroidRuntime(11587): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4353)
E/AndroidRuntime(11587): 	... 11 more
I/Process (11587): Sending signal. PID: 11587 SIG: 9
Lost connection to device.

Here is the particular commit at which this occurs for me: https://github.com/bradyt/cone/tree/ce9ba96dce29e855fe08e4114b08779d4dda2f2e.

@miguelpruivo
Copy link
Owner

Some file explorers manipulate and create their own URI which makes it really hard to handle all of those. That’s why the plugin description tells you that is made to be used with the native file explorer, which should work fine. If you use your own file explorer the it may or not work.

@miguelpruivo miguelpruivo added the help wanted Extra attention is needed label Feb 24, 2019
@miguelpruivo miguelpruivo added suggestion New feature or request and removed suggestion New feature or request labels Mar 13, 2019
@miguelpruivo
Copy link
Owner

This might be fixed as of 1.3.3. Feel free to reopen it if it isn't since I wasn't able to replicate this issue.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants