question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AndroidInsecureFileModeEnabled prefrence not working

See original GitHub issue

Bug Report

Problem

After Cordova 10 release Cordova added WebViewAssetLoader support which can cause data associated with the file:// scheme, such as cookies, local storage, local cache, and web-based databases

But if we set AndroidInsecureFileModeEnabled to true according to docs(https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html) it will work like earlier which is not working for me

Due to this I am facing cookies issue

What is expected to happen?

After setting AndroidInsecureFileModeEnabled preference to true in config.xml it should work like old one

Information

Command or Code

<preference name="AndroidInsecureFileModeEnabled" value="true" />

Environment, Platform, Device

Version information

Cordova-android@10.0.1

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
secretmoo35commented, Aug 18, 2021

This ticket does not give enough Information.

At best, I can only recommend upgrading to the latest cordova-android@10.1.0 and try again.

cordova platform rm android
cordova platform add android@latest

If you still have the issue after upgrading, try and provide more Information.

For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the index.html is loading from file:///android_asset/www/index.html… Application tab should also show that it is reading from file:// for the cookies, etc. If you see it checking file:// but there are no cookies, it probably means Android wiped out the information for more space.

Make sure to also test with 10.1.0 as it might have fixed that area.

Thanks. cordova-android@10.1.0 It’s works fine for me.

1reaction
erisucommented, Aug 17, 2021

This ticket does not give enough Information.

At best, I can only recommend upgrading to the latest cordova-android@10.1.0 and try again.

cordova platform rm android
cordova platform add android@latest

If you still have the issue after upgrading, try and provide more Information.

For example, provide the information that comes from the network & application tab of the DevTools and make sure its from both the working and non-working app. Both should show that the index.html is loading from file:///android_asset/www/index.html… Application tab should also show that it is reading from file:// for the cookies, etc. If you see it checking file:// but there are no cookies, it probably means Android wiped out the information for more space.

Make sure to also test with 10.1.0 as it might have fixed that area.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cordova 10 has CORS issue with allowList - Stack Overflow
AndroidInsecureFileModeEnabled set to true puts you back to file:/// scheme, as it was before cordova-android 10. There are no security issues, ...
Read more >
Config.xml - Apache Cordova
See the preference element of plugin.xml for more details on CLI variables. ... Use with caution, this may cause compatibility issues with web...
Read more >
CORS issue when testing on Android - Auth0 Community
... name="AndroidInsecureFileModeEnabled" value="true" />. It appears that the CORS issue was related to a local development problem and the ...
Read more >
[GitHub] [cordova-android] pawan-logiciel opened a new ...
Bug Report ## Problem After Cordova 10 release Cordova added ... After setting AndroidInsecureFileModeEnabled preference to true in ...
Read more >
Monaca HTML5 Resource Encryption
When using this plugin, the following options in config.xml are not available for Android. <preference name="AndroidInsecureFileModeEnabled" value="true" /> ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found