capacitor.config.json
"server": {
"androidScheme": "file"
}
The Angular app never starts now, but without this change to the configuration everything was working.
This is the error in the console:
styles.4ebb591….css:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
runtime-es2015.66c79b9….js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
polyfills-es2015.bb0…912616a6f89563.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
main-es2015.c53c0c9….js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
The path to these files are displayed as:
file:///styles.4ebb591052f4ba9ed5c0.css
file:///runtime-es2015.66c79b9d36e7169e27b0.js
etc…
If I change the Angular base-href to “./” (ng build --prod --base-href=./
) it seems like it can FIND the files now, but I now get CORS errors:
localhost/:1 Access to Script at 'file://localhost/runtime-es2015.66c79b9….js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
localhost/:1 Access to Script at 'file://localhost/main-es2015.c53c0c9….js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
localhost/:1 Access to Script at 'file://localhost/polyfills-es2015.bb0d229….js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Changing “androidScheme” works in a Vue app, but seemingly not Angular.