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="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></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=’http://code.jquery.com/jquery-1.6.4.min.js'[/xml]
“Whitelist Rejection” – Immediately I knew it was something to do with URLs not being accessible.
Solution
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.
Hi,
thanks! You saved my day! 😉
Whitelist rejection causes due to the URL given in Xcode can not identify that address.
Please check on this URL.
http://www.prosoxi.com/2011/10/08/xcode-phonegap-white-list-rejection/
Really great.. Thanks for saving my time
Thx… you saved my time!!
555
perfect, I had been going round in circles on this one!
Will whitelisting * cause problem with approval from App Store?
Exelente!!! me había atorado ya desde hace 3 días!! :S con eso!!
Thanks a lot!!
[…] (海外) PhoneGap Gotcha : ERROR whitelist rejection […]
Thanks….I enjoyed
Thanks mate, that was useful!
Thank you!
Been searching for two days for a solution 🙂
/Patrik
Thanks…
That was the right solution. Thanks!
Thanks Anuj!!! Your post helped me a lot…. :o).
You are welcome 🙂
Thanks buddy u save our time…:)
Спасибо огромное!)
A slightly better explanation of the issue and the solution is here…
http://davehiren.blogspot.com/2012/03/whitelist-rejection-error-in-xcode-for.html
Still looking for why phonegap maintains this Whitelist though. Will re-post if I find anything.
Hi anuj,
Thanks for the post code .It was really very useful to my project. pls keep the post for valuable code.
Excellent thank you so much!
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.
Thank Buddy…..!!
It was really very useful & works fine…
Happy Coding.
Hi, thks it’s very helpful 🙂
[…] (海外) PhoneGap Gotcha : ERROR whitelist rejection […]
You just saved my day. Thanks!
Thanks for documenting this!
I ended up adding it to the cordova.plist as I could not find a phonegap.plist and it worked just fine.
Thanks +1
Hi people…WHERE THE HELL IS THAT PLIST FILE???
Hi… just follow this link.
http://docs.phonegap.com/en/2.0.0/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide
Hi ALL, I don’t understand which external domain should I inform. The app is running locally…it’s not hosted. Should I inform “*.google.com”, so the app can access maps.google.com ?
TIA !
thanks a lot
thank you