PhoneGap Gotcha : ERROR whitelist rejection

On November 22, 2011, in Mobile, by Anuj Gakhar

I have been doing my first PhoneGap App today and as part of the exercise, I am using jQuery Mobile 1.0, PhoneGap 1.2 on Xcode 4.2 on my MacBook Pro. The first thing I did was to copy/paste some code from jQuery Mobile site into my HTML page. I won’t be pasting the entire code here but I was trying to include jQuery Mobile JS/CSS files in the page.
[html]<link rel="stylesheet" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>[/html]

And then I had some other HTML as well. However, when I tried to run the Build, in the Debug Area in XCode, I saw the following error come up :-
[xml]SampleApp[549:17803] ERROR whitelist rejection: url=’'[/xml]
“Whitelist Rejection” – Immediately I knew it was something to do with URLs not being accessible.


A quick Google Search confirmed that and the solution is easy. In your PhoneGap.plist file, you need to add the allowed URLs to the ExternalHosts array. I added “*” as I did not want to add each individual URL separately to the list but that’s your choice.

Tagged with:  

35 Responses to PhoneGap Gotcha : ERROR whitelist rejection

  1. Daniel says:


    thanks! You saved my day! 😉

  2. Sandeep says:

    Whitelist rejection causes due to the URL given in Xcode can not identify that address.
    Please check on this URL.

  3. Easwar says:

    Really great.. Thanks for saving my time

  4. kris says:

    Thx… you saved my time!!

  5. Daren says:

    perfect, I had been going round in circles on this one!

  6. Philip says:

    Will whitelisting * cause problem with approval from App Store?

  7. luismiKG says:

    Exelente!!! me había atorado ya desde hace 3 días!! :S con eso!!

  8. Paul says:

    Thanks a lot!!

  9. […] (海外) PhoneGap Gotcha : ERROR whitelist rejection […]

  10. Ranjith says:

    Thanks….I enjoyed

  11. Mihalis says:

    Thanks mate, that was useful!

  12. Thank you!

    Been searching for two days for a solution 🙂


  13. Chirag says:


  14. Si Chen says:

    That was the right solution. Thanks!

  15. Anuj Tyagi says:

    Thanks Anuj!!! Your post helped me a lot…. :o).

  16. Ankur sarda says:

    Thanks buddy u save our time…:)

  17. dm says:

    Спасибо огромное!)

  18. A slightly better explanation of the issue and the solution is here…

    Still looking for why phonegap maintains this Whitelist though. Will re-post if I find anything.

  19. Naga says:

    Hi anuj,
    Thanks for the post code .It was really very useful to my project. pls keep the post for valuable code.

  20. Steve Batcup says:

    Excellent thank you so much!

  21. Steve says:

    Dude, Thanks. I couldn’t find this shit anywhere. It’s been brutal, but this was the happy final hurdle to an otherwise lengthy night due to shitty ass documentation.

  22. Rishabh says:

    Thank Buddy…..!!
    It was really very useful & works fine…
    Happy Coding.

  23. Yves Laurent says:

    Hi, thks it’s very helpful 🙂

  24. […] (海外) PhoneGap Gotcha : ERROR whitelist rejection […]

  25. Misfiring says:

    You just saved my day. Thanks!

  26. Ben says:

    Thanks for documenting this!

  27. Nils says:

    I ended up adding it to the cordova.plist as I could not find a phonegap.plist and it worked just fine.

  28. yves says:

    Thanks +1

  29. Cesar says:


  30. Joseka says:

    Hi ALL, I don’t understand which external domain should I inform. The app is running locally…it’s not hosted. Should I inform “*”, so the app can access ?
    TIA !

  31. ravi says:

    thanks a lot

  32. prabu says:

    thank you

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2011 Anuj Gakhar