Hi all, I was trying to get phonegap build working with my ionic project. After 2 days of struggle here are the steps I took to make it work nicely without conflicting with the cli:
Create a repo for the www folder:
I really didn’t like this but it was a quick job. You should consider creating a separate branch that contains only the www folder but for now this worked for me.
Move your config.xml file to the www folder:
Create a relative symlink to the config in your project root folder (
ln -s -r www.config.xml config.xml). Then add www/config.xml to your main project .gitignore if you have your project already in git.
Add phonegap settings to your config.xml:
You will need to add the plugins here. Your widget tag should look like this:
Add any plugins that you are using, in my case, I had to add:
<gap:plugin name=“org.apache.cordova.console” />
<gap:plugin name=“org.apache.cordova.device” />
<gap:plugin name=“org.apache.cordova.geolocation” />
<gap:plugin name=“org.apache.cordova.inappbrowser” />
<gap:plugin name=“org.apache.cordova.splashscreen” />
Getting the splash screen to work:...
If you follow ionic’s [guidelines] on generating splashscreens, you will end up with a folder called resources on your project root directory. Move that to the www directory, symlink it and optionally add it to your main project gitignore file. Then change your config.xml file removing the generated markup. This is what ionic generates:
It should look like this:
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" gap:platform="android" gap:qualifier="xxxhdpi"/> <gap:splash src="resources/android/splash/drawable-land-ldpi-screen.png" gap:platform="android" gap:qualifier="land-ldpi"/>
And that is it, point phonegap build to your git repo and everyting builds as it should.