11 upcoming changes for Cordova iOS 2.1.0
1. Automatic Reference Counting (ARC) support
Finally the Cordova core has been upgraded to use ARC. Your project does NOT need to use ARC, but you can upgrade your project if you want using the Xcode menu option “Edit -> Refactor -> Convert to Objective-C ARC…”, then de-select libCordova.a. Note that if you do so, your plugins will need to be upgraded to use ARC as well. If doing so for plugins causes problems, you can disable ARC per file.
2. Removal of the (.pkg) Installer
This frankly was a stop gap in 2.0.0 until we removed it entirely. There is nothing to install now, you just download the source, and put it somewhere on your hard-drive in a permanent location. New projects when created using the command-line tool will refer to the CordovaLib that you ran the script from automatically. Note that if you move the source folder, you will need to run bin/update_cordova_subproject to update any existing projects.
3. Removal of the use of CORDOVALIB
In Cordova versions before 2.1.0, the location of the CordovaLib sub-project was through an Xcode variable called CORDOVALIB. So, when you updated your CordovaLib, your existing projects will pick up the new CordovaLib automatically by referencing this Xcode variable. This has proven to be problematic for using multiple versions of Cordova. Now, when you create a new project, the new project will have a hard-coded location for the CordovaLib sub-project, and to update this location you run the bin/update_cordova_subproject script which is located in a downloaded source version.
NOTE: This script updates the location of the CordovaLib sub-project as “relative to group” which means relative to where your project is located. This means, if you move your project folder, the CordovaLib sub-project reference will break (and you need to run the script again). This is mainly for source control purposes (where an absolute location is not friendly for teams). Watch this jira issue for updates.
4. Removal of the VERSION file dependency in code
The VERSION file is read from CordovaLib and set in JavaScript as the variable device.cordova, the code is not dependent on this file anymore (it may still be referred to in the Makefile), and reads the version from CDVAvailability.h at run-time.
5. Removal of CordovaLibApp and CordovaLibTest targets from the CordovaLib sub-project
When the CordovaLib sub-project is included in your project, all of its targets are included in the Schemes dropdown menu as well. This confused a lot of devs, and we removed the two extraneous targets into its own project. Those two targets are only used for testing. So now your Schemes dropdown menu will only include your project’s target, and the CordovaLib target.
6. Command-line scripts supports spaces in pathnames, symlinks
If you had spaces in your path when you ran any of the command-line scripts in 2.0.0, the script will fail. We fixed the problem in Cordova 2.1.0. If you are running 2.0.0, you can fix the problem by just copying in the updated scripts to your project’s cordova sub-folder.
7. Whitelist format is less strict
Previously, the whitelist required an exact string match, with hostnames/IPs only. Now you can enter a full url with scheme, paths and query parameters – they will be parsed and only the hostname/IP will be considered.
8. New JavaScript->Native bridge
Our previous method used iframes, and starting with 2.1.0, we added an xhr bridge method by default. More details in this JIRA issue. This is to work around crash issues related to iOS UIWebView WebKit. You can change to the previous bridge implementation as well, the details are in the same JIRA issue linked previously. Note however that there is a bug in using the xhr bridge mode in iOS 4.2, so if you are on iOS 4.x, it will automatically default back to the iframe bridge.
9. iOS 6 compatibility changes
Fixed some issues related to the upcoming iOS 6 release. ‘Nuff said.
10. Diagnostics
There have been a lot of problems related to headers not being found, or the Archive build failing. There will be a diagnostics tool to help debug these issues. This tool is not in the rc1 yet, but will be in the final 2.1 release. Watch the related JIRA issue here.
11. New plugin signature (old signature is deprecated)
The new plugin signature is discussed in the Plugin Development Guide for iOS and also the Plugin Upgrade Guide. The old signature is still supported as per our deprecation policy.
This is very useful for Developers upgrading from previous versions. I find the official docs lack this level of documentation. Very Sexy. Thanks Shazron.
Ally
August 29, 2012 at 2:44 am
Concerned about 8. New JavaScript->Native bridge
“twice as slow” bridge? That would really suck
Ally
August 29, 2012 at 2:58 am
In most cases, practically the speed would not matter. We provide the option of you switching back to the old bridge – but providing the xhr bridge as the default option works around the more critical issues related to crashing. We are at the mercy of the underlying bugs in WebKit, and we had no other choice to prevent crashes.
shazron
August 29, 2012 at 8:45 am
Hi, When this version will be released ? I plan to start a project with Phonegap, but i want to do it directly with this version. And can’t find a detailed roadmap
Christophe
August 29, 2012 at 9:56 am
Here’s the schedule by consensus on the callback-dev mailing list:
2.1.0rc1 : Aug 24th (tagged in all the repos)
2.1.0rc2 : Aug 30th
2.1.0 : Sept 4th ( after Labour day weekend )
shazron
August 29, 2012 at 6:27 pm
Is 2.1.0 going to be released soon? I have Xcode 4.4.1 and can’t build a default project with 2.0.0!
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 7:38 pm
It’s going to be released the week of Sept 10th. What’s wrong with 2.0.0? Let me know.
shazron
September 6, 2012 at 8:01 pm
I’m having the same issue as here: https://groups.google.com/forum/?fromgroups=#!topic/phonegap/gXR7RSfkkpA%5B1-25%5D
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 8:05 pm
Ah ok – like I mentioned those warnings are harmless. In any case, you should wait for 2.1.0, there are more bug fixes included as well.
shazron
September 6, 2012 at 8:08 pm
Maybe I’m doing something wrong, but I can’t run it with all these showing?
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 8:09 pm
Are there actual build errors (red octagons) not warnings (yellow triangles) when you build? Isolate the errors and report back.
shazron
September 6, 2012 at 8:15 pm
All I did was create a base project via the command line (since it doesn’t show up in the application launcher when I start Xcode), and attempted to build and run it. 19 yellow issues, nothing is red. This could very well be a user error–I just have no options to run this anywhere… not in any menus or buttons or anywhere. :O I had assumed that the yellow warnings were preventing me from having the option to run it.
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 8:23 pm
Check out the “Deploy to Simulator” section on http://docs.phonegap.com/en/2.0.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS – I believe you will need to set the Active Scheme to your project’s name instead of CordovaLib, for it to be deployed successfully. I think that could be the problem.
shazron
September 6, 2012 at 8:29 pm
Ok, thanks, I’ll try this shortly.
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 8:30 pm
Ah, that works.
For anyone using Xcode 4.4.1 or (potentially?) similar:
You find the scheme in the Product menu, then Edit Scheme (Command + <). Change the two drop downs at the top of the screen to your project name, and then the device you want to simulate. Hit ok, and then go to the Product menu and select Run (Command + R). Wait, be patient! It eventually shows up.
akismet-c315696200473233f160e90bce81ce38
September 6, 2012 at 9:10 pm
thank you shazron
Emile Khattar
August 29, 2012 at 6:16 pm
[...] 2.1 release. If you haven’t seen it already, be sure to check out Shazron’s post: 11 upcoming changes for Cordova iOS 2.1. Changes include Automated Rererecnce Counting (ARC) support, an updated Native-JavaScript [...]
Andrew Trice » Blog Archive » Upcoming Changes with PhoneGap 2.1 & iOS 6
August 29, 2012 at 6:18 pm
Curious as to what may have changed in the .xcodeproj file that is failing for my build when testing with RubyMotion build tools and 2.1rc2. Hoping you may be able to point out something obvious.
I wrote up an article about this, which is working great on 2.0, but fails to build on 2.1rc2
http://www.willprater.me/blog/2012/08/21/using-rubymotion-to-build-javaScript-based-ios-apps/
Error:
====
Build vendor/CordovaLib
ERROR! Building vendor project `vendor/CordovaLib’ failed to create at least one `.a’ library.
====
Will Prater
September 2, 2012 at 2:02 pm
you can remove the above comment, I figured it out. I’d left the other .xcodeproj file in there and it was not sure which config to build towards! You can specify the file to use in the build task.
Will Prater
September 3, 2012 at 2:07 pm
[...] 11 Upcoming Changes for Cordova iOS 2.1.0, Shazron Abdullah [...]
PhoneGap Community Roundup – August 2012 | SDK News
September 7, 2012 at 1:04 pm
Hi i looked into cordova re camera jquery, and i have this question
Can i have a mobile app where i can capture my photo and then add an image above it and save it.
like take my face and put hat about it?
hope to hear from you soon..
Thanks
Molham
Molham Bakir
September 12, 2012 at 5:59 am
Hi, questions like these are best suited for the Google Group: https://groups.google.com/forum/?fromgroups#!forum/phonegap
But yes. You’ll have to play with the HTML canvas after retrieving the image data. Post a message on the group, others can chime in as well.
shazron
September 12, 2012 at 7:00 am
The contacts on iOS 6.0 are not loading with this update … any news?
Matthew Encke
September 23, 2012 at 3:19 am
Sorry that fix didn’t make it – should be in 2.2.0
shazron
October 17, 2012 at 11:22 pm
[...] been fully migrated to use Automatic Reference Counting (ARC). Checkout Shazron’s blog about changes in Cordova 2.1.0 for iOS and how to update plugins to work with ARC. PhoneGap also supports iOS 6 [...]
PhoneGap 2.1.0 Released | SDK News
September 25, 2012 at 6:55 am
Hi,
im having the orientation issue with xcode4.5 that has reportedly been fixed in phonegap 2.1. Iv downloaded and installed PG2.1 but the issue is still there. Even in the default app that is made when PG is installed (without any change whats so ever) has this issue. Basically, the app retains the width it starts in, if started in landscape, remains larger than the screen with in portrait, or if launched in portrait, is smaller in width than the landscape width with black area to the right, in both iphone and ipad.
Iv been searching and trying a fix by tweaking the xcode orientation settings of the app for 2 days now without any luck. Is there anything i can do to fix this issue.
Thanks
Fahad
September 27, 2012 at 4:20 pm
After 2 days of searching, if found the issue, which was quite silly in the end. The new phonegap projects index.html file has this meta tag of viewport that sets width and hight to constant. This replicates the exact issue that was due to xcode4.5 (reportedly fixed in PG 2.1). Every time i created a new project to test it would always have the same issue of not adjusting width. During my previous fixing attempts for the original problem i had copied the exact meta tags from the default PG project. Fixed after removing those attributes from the viewport meta tag.
Fahad
September 28, 2012 at 12:14 pm
Also it might be this issue: https://issues.apache.org/jira/browse/CB-1465
shazron
October 17, 2012 at 11:24 pm
[...] 11 upcoming changes for Cordova iOS 2.1.0 « Shazron’s Cordova (aka PhoneGap) Blog – 11 upcoming changes for Cordova iOS 2.1.0 [...]
Links for September 25th through October 1st
October 2, 2012 at 2:46 am
[...] Following this Cordova developer’s blog regarding changes to Cordova 2.1.0: http://shazronatadobe.wordpress.com/2012/08/28/10-upcoming-changes-for-cordova-ios-2-1-0/ [...]
Installing the chbrody SLQite Plugin into Cordova 2.1.0 in iOS « iPhone Dev Log
October 5, 2012 at 7:47 pm
Hi when I use Cordova 2.1 to build applications.I meet a problem.Xcode can’t update launch images and icons.Even if I replace the files in the folder.But it doesn’t work.How to deal with it?Please tell me … Hope for your reply …
CashLee李秉骏 (@Bingjun_Lee)
October 9, 2012 at 12:07 pm
Solved by you
–> http://stackoverflow.com/a/12884191/219684
shazron
October 17, 2012 at 11:26 pm
I did a fresh install on a computer that did not have PG before, but encountered serious issues with building for iOS. My target is set to my project, yet it does not compile. I get the following errors:
Cordova/CDVViewController not found
Cordova/CDVViewController.h file not found
I followed the install guide for ios steps on the getting started guide (aside from executing the .pkg as there is none), but it does not work.
Any ideas as to how to fix this?
Thanks
ayame007
October 19, 2012 at 2:40 pm
Did you still need help with this? Let me know I can walk you through an/or make you run a diagnostic script.
shazron
October 30, 2012 at 10:56 pm
Hi Shazron, Thanks very much for the post. I have an ios application based on phonegap 1.4.1, I would like to upgrade my project to the latest version of the phonegap, what is the best approach?
I have asked this question in stack over flow, waiting for your response. Thanks http://stackoverflow.com/questions/13266259/upgrade-phonegap-for-ios-from-1-4-1-to-latest
Claire
November 7, 2012 at 9:18 am
Hi, I replied to your StackOverflow post.
shazron
November 7, 2012 at 9:06 pm
Hi Shazron, thanks so much for you suggestion. I will try that. Will keep you updated.
Claire
November 7, 2012 at 9:38 pm