Executing script found in config.xml for hook “after_prepare”:/scripts/forcelightmode.js Script file does’t exist and will be skipped: /scripts/forcelightmode.js``
After adding “scripts” to the extraFiles in the Properties window (one file per line), I now get this error:
Executing script found in config.xml for hook "after_prepare": scripts/AndroidLightMode.js
Script file does't exist and will be skipped: /scripts/AndroidLightMode.js
Note I renamed the .js file and updated the config to match.
Looking at the log snippets above, it seems to be adding the first “/”, = “/scripts/AndroidLightMode.js”, it should be “scripts/AndroidLightMode.js”, as set in the config.
I put a file named AndroidLightMode.js into the scripts folder.
I added one line to that file: console.log(“AndroidLightMode.js executed”);
I added scripts/AndroidLightMode.js to extrafiles in Project Properties
I added <hook type="after_prepare" src="www/scripts/AndroidLightMode.js" /> to the config.xml Voltbuilder project property.
Submitted to voltbuilder. This is in the log: Prepared android project successfully Executing script found in config.xml for hook “after_prepare”: www/scripts/AndroidLightMode.js AndroidLightMode.js executed
The proper path starts with www: the first thing VoltBuilder does is copy all your files into a www folder.
That’s great thank you. I’m working on the iOS version now, I’ll give it a go soon.
The reason for needing to force lightmode on Android is because on Android I’ve found that long text in a Select option doesn’t text-wrap when shown in the dropdown, so I’ve had to make a custom one but I can’t match Androids dark mode colors as they vary per device, hence forcing light mode.