Migrating values in localStorage from Cordova app to Capacitor app

My company is in the process of migrating our old Cordova app (non-Ionic) to Capacitor. As part of this we would like to migrate the values stored in localStorage.

There’s a topic in the migration guide here: Capacitor - build cross platform apps with the web but I’m running into a problem. It seems like our Cordova app is being served from file://{some_path_into_the_filesystem} both on Android and iOS (I checked that by inspecting our apps and getting the value of window.origin).

In capacitor.config.ts I tried to change the server.iosScheme and server.androidScheme to file, but with no luck. When I build the Android app it simply crashes on startup with the error Not allowed to load local resource: file://localhost/ (see screenshot below).

The iOS app is not affected by this change (it serves from the default capacitor:// scheme).

Have any of you run into this problem?

Thanks a lot!

I still have this issue… messing with schemes didn’t work at all for me…
After the migration to Capacitor I can’t access the data from the older app version, in both platforms Android and iOS…
I can’t publish my app like this

Does anyone have solution for it? I am having the same problem.