Butterfly icon indicating copy to clipboard operation
Butterfly copied to clipboard

[Bug]: Add option to change data directory on android

Open jhc86 opened this issue 1 year ago • 4 comments
trafficstars

What happened?

When adding a default local connection, I exit the app and then start it to receive this message: FileSystemException: Creation failed, path = 'content:' (OS Error: Read-only file system, errno = 30

I also cannot seem to save anything to the connection.

Path: content://com.android.externalstorage.documents/tree/primary%3AButterfly

Same result on two Android systems: GrapheneOS (Android 14) Samsung Galaxy S21 FE 5G (Android 13)

Version

2.0.1-rc.0

Platform

Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

jhc86 avatar Jan 09 '24 20:01 jhc86

Bug confirmed. I will look at it

CodeDoctorDE avatar Jan 10 '24 07:01 CodeDoctorDE

Hmm, I use the file_selector package that uses the OPEN_DIR intent to access the folder. Seems like the new android 11 storage system does not work good with it... If anyone wants to help feel free to make a pull request

CodeDoctorDE avatar Jan 10 '24 09:01 CodeDoctorDE

I researched a bit and the problem is: the getDirectoryPath function gives me a content uri instead of a path and dart cannot work with uris and only with paths. But I have currently no solution how to fix this. if anyone has more information regarding this, feel free to add a comment here

CodeDoctorDE avatar Jan 10 '24 10:01 CodeDoctorDE

I created an issue on the flutter repository: https://github.com/flutter/flutter/issues/141250. After this is closed I will reenable this feature in the android version

CodeDoctorDE avatar Jan 29 '24 18:01 CodeDoctorDE

The time has come... The issue was closed in the library. I will reenable this feature for android in the 2.1.0-rc.1 update 🎉

CodeDoctorDE avatar Apr 30 '24 06:04 CodeDoctorDE

Fixed in 2.1.0-rc.1

CodeDoctorDE avatar May 01 '24 08:05 CodeDoctorDE