I am trying to set up an Ionic build on Bitrise with a Fastlane script. As part of the build process a js script is run via node:
sh "cd .. && node ./scripts/setupEnvironment.js --env=#{environment}"
The final step of this js script is to run exec('ionic cordova resources --force');
in order to recreate the resources. If I run the Fastlane lane directly this all works fine, and if I run the ionic cordova resources
command directly it works fine too. It's only when I run bitrise run primary
on a fresh clone that it never seems to generate the resources, and fails with the error "Exit status of command 'cordova platform add android' was 1 instead of 0. (FastlaneCore::Interface::FastlaneShellError)
Source path does not exist: resources/android/icon/drawable-hdpi-icon.png"
If I run Fastlane or ionic cordova resources
at any time, then delete the 'resources/android' directory that was created, Bitrise then has no problem running and will happily create the resources in future. It's as if the 'resources/android' folder needs to be created once (and can then be deleted) before Bitrise will be able to create the resources in future.