6
votes

I've noticed that while most of the differences between cordova / PhoneGap and PhoneGap build are fairly minor, one seems to give me a little more trouble -- the expected paths for icons and splash screens:

Cordova docs:

  • place config.xml at the root -- app/config.xml
  • reference icon and splash screen files with path relative to the root

PhoneGap Build docs:

  • place config.xml in the www folder -- app/www/config.xml
  • reference icon and splash screen files with path relative to the www directory

This ends up breaking either the copy of the icons / splash screens on PhoneGap Build or in the CLI. Has anyone found a way around this issue, so that both local and PhoneGap Build - generated apps have the icons they need?

2
Will it work if you put the folders and files in both locations? - Steve
Kind of. If you add a batch file to copy the stuff up from /app/www/res to /app/res, it'll pick it up. You just need to remember to add the app/res directory to the .gitignore file, or you'll end up with two copies in your github repo. I've added that workaround to the answers below. - eb1

2 Answers

1
votes

@eb1 this explains alot of the questions here and at the Google Group. Using symlinks will not work, because that will only work with Unix/Linux and it's likely to break on the Build. I've seen someone using scripts (batch files) to do the copying. To me this seems to be the best solution until we can get Phonegap to fix this. They have fixed inconsistencies like this in the past. I think we just have to make enough noise. --Jesse

1
votes

Real Answer

After a bit of internet searching, I found this open issue on the phonegap-cli GitHub repo:

https://github.com/phonegap/phonegap-cli/issues/522

The issue does not currently have a milestone set for it, but it looks like it's the right place for adding our support for a more permanent fix for this problem. If you'd like this fixed, please add a comment on the issue so the PG team can get a sense of how many people are effected by it.

Workaround

The workaround here is mentioned by @JesseMonroy650 -- create a batch command to copy app/www/res to app/res for local builds.

This also requires the following be added to your .gitignore:

## ignore copied (local) directories
res/

This way you don't get two copies of the /res folder checked in to your repo.