Skip to content

[WIP] Fix bug with existing butterfly files directory on Android#1001

Closed
Copilot wants to merge 1 commit intodevelopfrom
copilot/fix-butterfly-data-directory
Closed

[WIP] Fix bug with existing butterfly files directory on Android#1001
Copilot wants to merge 1 commit intodevelopfrom
copilot/fix-butterfly-data-directory

Conversation

Copy link

Copilot AI commented Dec 6, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: use existing directory of butterfly files with another installation</issue_title>
<issue_description>### What happened?

I have directory in ./Documents for Butterfly files, but a can not add it as data folder an Android.
This prevents from using both nightly and stable version on the same device, and also using the app from other device with synced storage.

Version

2.4.1

Platform

Android

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct</issue_description>

Comments on the Issue (you are @copilot in this section)

@CodeDoctorDE Im not sure what you mean. You can change the data directory in the settings @CodeDoctorDE Strange, tested it myself and it works correctly and will be changed successfully. Can you give me more specific information about your device? @CodeDoctorDE Okay... does this also happen in the nightly version? @CodeDoctorDE Can reproduce it, but sadly looks like an android specific permission issue: ``` E/flutter ( 5910): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PathAccessException: Cannot copy file to '/storage/emulated/0/Documents/Butterfly/Templates/Light.bfly', path = '/storage/emulated/0/Android/data/dev.linwood.butterfly.nightly/files/Linwood/Butterfly/Templates/Light.bfly' (OS Error: Permission denied, errno = 13) ```

I'm open for ideas/pull requests that fixes the issue.

The problem is this:
I'm using ACTION_OPEN_DOCUMENT_TREE to get the folder with file picker: https://github.com/miguelpruivo/flutter_file_picker.

https://developer.android.com/training/data-storage/shared/documents-files?hl=en#grant-access-directory

https://github.com/miguelpruivo/flutter_file_picker/blob/33476e19bb660c4258e8f4b46b28ddbe7749384b/android/src/main/kotlin/com/mr/flutter/plugin/filepicker/FileUtils.kt#L135</comment_new>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: use existing directory of butterfly files with another installation

2 participants