"AndroidPersistentFileLocation" attribute not already support by PGB 5.2.0

  • 4
  • Problem
  • Updated 5 years ago
  • Not a Problem
when I use "cordova-plugin-file" 2.1.0 version
Android work perfect

but now I use the latest "cordova-plugin-file" 3.0.0 version
all code are the same but function was broken

so I trace the release note
https://github.com/apache/cordova-plu...
the 3.0.0 version told us "Make Android default persistent file location internal"

for detail to this
https://github.com/apache/cordova-plu...
it must be add "AndroidPersistentFileLocation" attribute and set "Compatibility" in the config.xml otherwise it will use "Internal" value to default

I try to use this way in PGB's config.xml,but not work
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes

Posted 5 years ago

  • 4
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
You knew we are still at 5.1.1 right?
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi Amir
but in PGB it already can use cli-5.2.0
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
No official announcement. Don't use it

I'll ask engineers about why it is listed. Meantime, stick with 5.1.1

Thanks.
(Edited)
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
got it
thanks Amir
so you mean is if maybe future have a "AndroidPersistentFileLocation" attribute support in the "5.2.0" stable version ?
my question just want to ask this...
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Yes, most probably it will be included on 5.2.0 release.

Cheers
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
thanks Amir
hope one day can use 5.2.0 ASAP
Photo of Martin Buchalik

Martin Buchalik

  • 8 Posts
  • 1 Reply Like
Is there any update or maybe another solution? I wanted to publish my app but without a working file system, it is pretty useless :( Is there maybe another way to make window.requestFileSystem point to the good old "/storage/emulated/0" instead of "/data/data/{android package}/files/files/"?
Photo of Siva Ram

Siva Ram

  • 5 Posts
  • 0 Reply Likes
@Martin Buchalik : Even i am looking for the same solution what you are looking for
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi Amir
is there any update news about "AndroidPersistentFileLocation" ?
Photo of Phone Gapps

Phone Gapps

  • 57 Posts
  • 0 Reply Likes
I'm using the following in my config.xml:
<preference name='phonegap-version' value='cli-5.2.0' />

<gap:plugin name="cordova-plugin-file" version="3.0.0" source="npm"/>
<preference name="AndroidPersistentFileLocation" value="Compatibility" />


but when I call directoryEntry.nativeURL() I still get "file:///data/data/appid/...".
Photo of Phone Gapps

Phone Gapps

  • 57 Posts
  • 0 Reply Likes
Going back to <gap:plugin name="cordova-plugin-file" version="2.1.0" source="npm"/> fixes the issue as the change is in version 3.
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi Phone Gapps
ya...going back to 2.1.0 version can Temporary solve the issue
but in fact,PGB should support "AndroidPersistentFileLocation" attribute
but for now there is no any reply
Photo of Phone Gapps

Phone Gapps

  • 57 Posts
  • 0 Reply Likes
Yes obviously we should be able to use v3.0.0 on PGB.

I ended up using v3.0.0 but I now explicitly use cordova.file.externalRootDirectory on Android instead of relying on fileSystem.root which in v3.0.0 defaults to cordova.file.applicationStorageDirectory.

I'll be able to remove the hack once PGB handles AndroidPersistentFileLocation correctly.
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
thanks Phone Gapps's feedback
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi Amir
is there any update progress about "AndroidPersistentFileLocation" ?
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
still "Not a problem" ??
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
hi PGB team
any reply about this ?
"AndroidPersistentFileLocation" attribute support ?
Photo of Martin Buchalik

Martin Buchalik

  • 8 Posts
  • 1 Reply Like
@ColinBau
I think I have found a solution that works on my application even without AndroidPersistentFileLocation.
Have you already looked at
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory, function(dirEntry) {
// Some function here
})

? This might be what you need...
Photo of ColinBau

ColinBau

  • 730 Posts
  • 18 Reply Likes
thanks @Martin Buchalik
I will try your way
well...
in the latest 4.0 version (although the "npm" have not already the latest verison)
https://github.com/apache/cordova-plu...
you can see the keywords
"Do not inject default AndroidPersistentFileLocation into config.xml"
so I guess,if PGB someday can use latest 4.0 version,maybe will solve this issue