Flutter Directory path and Directory create path are different

Issue

It’s very odd, when I call getApplicationDocumentsDirectory() it returns the following path:

/data/user/0/co.XXX.dev/app_flutter

While running (await getApplicationDocumentsDirectory()).create(recursive: true) creates a new folder at the above path:

/data/data/co.XXX.dev/app_flutter

According to Android Studio Device File Explorer the two paths are different

enter image description here

Why does it create the directory on a different path?

Solution

The two paths are linked to the same directory

According to @blackapps (without further explanation), the two paths are linked to the same directory.

For that reason, when I create new files from one path, I’m able to read them from the other path.

If someone can explain more about the aim of this link, please edit this answer.

Answered By – genericUser

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published