Phonegap/Cordova – never again.

660 views
Skip to first unread message

Andi

unread,
Apr 26, 2014, 7:42:42 AM4/26/14
to phon...@googlegroups.com
Hi!

I'm trying to "update" a project from Phonegap 2.1 to 3.4. The projects contains the iOS and Android platform and is using a native Objective-C plugin on iOS to handle launching Apple Maps with paramaters.
I decided the "easiest way" would be to start a new Cordova/Phonegap (yeah, you had to rename is and now confuse everyone by using sometimes phonegap and sometimes cordova in the code/docs/everywhere. thanks for that!) project.
After some searching I decided to use the cordova CLI, not the phonegap CLI. After being forced to install nodejs and npm (ok, I had these installed already), I had to install "brew" to install "ant" and some other stuff. Now finally I was able to create a simple example project which compiled in XCode and Eclipse. Wow, finally.
Then I added my app source codes and tried to run the app. The first problem was, that I was missing all the phonegap/cordova standard plugins, so I installed them using the CLI. After that the app still would not run, because the API for device.platform changed and returned "ios" instead of "iPhone"/"iPad", which broke the detection if the App should run in phone or tablet mode. The Cordova/Phonegap docs where no help, because the version 3.4.0 version of the docs has broken links for all the plugins api docs. I fixed this for now, but the much bigger problem is the native plugin.
I tried creating a cordova plugin creating the neccessary xml files and all the other need overhead. Then I had to install "plugman" in order to install the plugin... it didn't go so well. At first I thought it might work, but something was wrong. I then installed the "status bar" plugin for the ios 7 status bar. This plugin didn't work either. I always get an error in the XCode console that one or the other plugin does not exist or isn't cdv plugin... 

I would try to be more specific, but there are so many problems, that I don't think anyone can help me just ready this post...

What I wanted to say:
I hate phonegap/cordova. Really. It's the biggest crap of a framework I have ever worked with. The APIs and ways to integrate the phonegap/cordova lib in xCode have changed 3 or 4 times. The plugin API has changed multiple times. The way plugins are installed has changed. Version 1.8 worked, version 2.1 worked after some work, bur version 3.4 is unusable, because instead of describing what has to go where, there are just the cordova, phonegap, plugman CLIs which should do all the work, but fail most of the time. The CLIs are redundant, confusing, not very well documented and just overly complex.

Phonegap/Cordova should be a framework enabling me to create native apps with html/js, but in truth it has become a playground for (adobe?) developers creating a unmanageable monster. 

All this should not be so hard. I had in running in version 2.1 and now I have wasted over 10 hours and didn't get my projects running again. I'm doing this project for a fixed price, so every hour I waste makes this project less lucrative. 

Someone should fork Cordova, remove all the unneccesary complexity, create a decent documentation,...

This project is backed by adobe, there should be more money available to maintain a LTS version, and instead of publishing a new version every 3 month there should be only bugfixes which don't break things that worked perfectly. And maybe 1 new version per year.

Does anyone know an alternative to cordova? I'm really tired trying to figure out what I have to do, to get my project running again. I have already spend more time trying to port my app from phonegap 2.1 to 3.4 than the planned changes to the app would take me to do! i just want to handle the iOS 7 status bar and add 2 new options in the App. Without all the cordova upgrade horror I could have done this in 1-3 hours!

I like the idea of cordova, but the implementation is a catastrophe. 

Ryan Archer

unread,
Apr 26, 2014, 8:35:29 AM4/26/14
to phon...@googlegroups.com
Hi Andi,

I can share some of your frustration regarding the messy 'blob' evolution of Cordova. Seems like there is no strong direction for the platform yet. We let some things go because its open source but Cordova does take it a bit far.

What version of Xcode are you using? I recently upgraded to Xcode 5.1 because I agreed to update to iOS 7.1 on my Apple devices (Apple force you to upgrade Xcode). I had a lot of issues with compiling Phonegap 3.4 projects. But after following Shazron's workaround solution I was able to successfully build projects in Xcode again.

I am using the status bar plugin on my projects and it seems to work ok. I only upgraded my project from Cordova 3.0 to 3.4 so my issues were probably much smaller. I can see updating is pretty painful in the Cordova environment so I would avoid doing it (if you can) and just make a new project with a new version. Copy over the HTML, CSS and JS files and reinstall the plugins using node. Most importantly, leave yourself a lot of time and contingency to iron out the bugs. 

I have hope for Cordova to mature over the next few years. Right now it seems to be behaving like a cantankerous 5 year old child who sometimes listens to my directions....

jcesarmobile

unread,
Apr 26, 2014, 11:43:26 AM4/26/14
to phon...@googlegroups.com
I think it's adobe's master plan, they made the cordova development so complex that everybody will use the phonegap build service instead

Anyways, phonegap 2.1 was released 19 months ago, that's a lot of time to not expect changes, and phonegap 3 was released 9 months ago, enough time to learn how to use the CLI, I think it was you mistake to accept a fixed price project without enough information about the framework you have to use

Even if the phonegap 3.4 documentation is broken you can still use previous versions documentation, 3.3.0 works fine http://docs.phonegap.com/en/3.3.0/index.html and it's almost the same.

If you don't want to use the CLI you can use 2.9.1, it have some back fixes. And for the status bar you can "fix" it with just css and js adding a 20px margin on iOS 7, and the status bar plugin might work too (not tested)

Steve Sobol - Lobos Studios

unread,
Apr 26, 2014, 11:52:54 AM4/26/14
to phon...@googlegroups.com
At some point I believe I volunteered to update the official docs. If I didn't, I am now. Who do I talk to?

The build process is NOT well-documented. I want to fix that problem.

jcesarmobile wrote:
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Lobos Studios - Website Design, Mobile App Development, IT Support
Toll Free Phone/FAX: 877.919.4WEB
Victor Valley Phone/FAX: 760.684.8859
Los Angeles Phone/FAX: 310.945.2410
Business Cell: 310.487.2362
www.LobosStudios.com * www.facebook.com/LobosStudios * @LobosStudios

Dan Moore

unread,
Apr 27, 2014, 4:07:30 PM4/27/14
to phon...@googlegroups.com
Hi Steve.

I'd start here: http://cordova.apache.org/#contribute

There's a dev mailing list and a jira and some github repositories. 

That is for Cordova--I didn't find a way to contribute to phonegap, but I didn't look too hard.

Thanks for anything you can contribute!
--
Dan Moore
Developing with Cordova CLI
https://leanpub.com/developingwithcordovacli

Dan Moore

unread,
Apr 27, 2014, 4:13:10 PM4/27/14
to phon...@googlegroups.com
Hi Andi,

I hope you feel a bit less frustrated today, but I understand your aggravation.

As some other folks have mentioned, moving from 2.1 to 3.4 is a big leap for any software let alone software targeting mobile devices (which have a fast release cycle as well).

That said, I'd love an LTS version of Cordova--when we were developing on it, the fast moving release cycle was a pain in the butt.  But would anyone pay for the LTS (either in money or in time)?

As far as alternatives, there are a few.  Here's an article Google thought highly of: http://www.developereconomics.com/pros-cons-top-5-cross-platform-tools/  I've known folks who have used Titanium and others who use a thin layer over a webview (esp if you are only targeting iOS and Android), which is eloquently outlined here: https://medium.com/this-could-be-better/14972c0609d


--
Dan Moore
Developing with Cordova CLI
https://leanpub.com/developingwithcordovacli

JP

unread,
Apr 28, 2014, 12:01:15 PM4/28/14
to phon...@googlegroups.com
I can feel your pain. I got a bit frustrated with things working then not working.

Most recently I was having trouble building to my iphone 5s. I found a post on stackoverflow that linked to another post somewhere else and so on. The gist is that there seems to be some sort of bug with 3.4 that will be corrected in 3.5 with linking errors. I went through my project configuring arm64 and got it to build successfully. However, I still got 14 different cordova errors. Everything seemed to be working so I submitted it to Apple anyways. We shall see. Crossing my fingers.

Alain Ekambi

unread,
Apr 28, 2014, 2:26:19 PM4/28/14
to phon...@googlegroups.com
Same feeling here.

This project looks more and more like a test field of Google's and Adobe Engineers for their internal projects.

Things are just breaking all the time after each release. Insane !





--

Kerri Shotts

unread,
Apr 28, 2014, 3:20:42 PM4/28/14
to phon...@googlegroups.com
Hi Andi --

Cordova and PhoneGap have quite a few pain points, I agree. That said, I do think the developers care very, /very/ much about the project, and I would think it would be a good thing to know that the framework is being actively developed.

2.1 to 3.4 is a /huge/ jump, and breakages in code are to be expected. Assuming breaking changes every 6 month, 3.4 is 3 breaking changes beyond your initial project. Breaking changes /suck/, I know, but sometimes they do have to be introduced to ensure quality and forward motion. I know, I know -- I /hate/ them as much as you do, but I'd rather a relatively clean and modern code base than a crusty, aging, mess of code that supports ancient versions and has all sorts of unexpected interactions due to the different mechanisms that must be supported.

Now, when I say I feel your pain: I really do -- since I'm in the process of writing a book about the framework. I've had to deal with breaking changes several times during the writing of the book, and as frustrating as they are, I also can see the end goal, and those changes were probably necessary. Could they have been better handled? Perhaps yes, perhaps no. Sometimes progress comes at the cost of some breakage.

Some things I've run into that might ease your pain:
1) Upgrading projects between 3.x has largely been eased by the CLI. Is it as easy as it could be? No, but it is getting there. All I can say is going from one 3.x version to the next has been /far/ easier than going from 2.x to 3.x. 

  Tip: There's a cordova platform update command, which is great, but the plugins don't have it (yet). I've built a shell script for my projects that updates the platforms, and then removes and re-adds the plugins to the project. Works a peach, and makes the upgrade process itself a one line command.  If only managing breaks in the code were this simple.

2) Try removing and adding back your iOS platform when you get oddball errors out of Xcode. More often than not, that's fixed my problems. If that doesn't help, remove the plugins first and add them back last. 
3) I agree that cordova vs phonegap is a bit odd, but it makes sense when you understand the history of the project. Consider Phonegap an enhanced version of cordova -- for example, Phonegap can build projects using PG Build. 
4) For those people who were used to the ability to use Phonegap largely in an IDE, the CLI is oftentimes seen as a "step backward". However, when you know some of the problems that resulted from trying to integrate into so many varying IDEs, it makes far more sense to take a CLI approach. You can still use the IDE, of course, but consider this: for the first edition of my book in the early 2.x days, creating a multi-platform project supporting iOS and Android took close to 50 terminal commands to accomplish what the CLI does in just a few. Why? Copying www directories around manually is cumbersome and prone to error, and so part of those 50 commands involved setting up a root level www directory, followed by symbolic links into each IDE's project. This was far from ideal, /but it worked/. And then the CLI came along, and *poof* all those commands get boiled down to just a few, and my life (and the book) is far better off for it. It's funny, but there was a time when I was trying to come up with a CLI-lite for 2.x, and now that I look at it, it's crazy how closely aligned it was with the current CLI.
5) #4 aside, I did have some issues with node.js as a requirement. The original point of Phonegap was that it was easy to get a project created and building, assuming you could set up the IDE. Nothing else was required, and it certainly eased entry into the environment. Now, of course, there's all sorts of things you have to worry about, unless you're using phonegap build. But I also understand that node.js provides a lot of good features as well, and has virtually become a pre-requisite for a lot of web development, and so it doesn't make much sense to rail against it. You yourself admit that you already had it installed. 
5b) On a side note, you could chalk having to use brew to install ant as an Apple thing. For whatever reason, they removed Ant from 10.9. Let me tell you, when 10.9 was released,  it took a couple days to get everything back to working order.
6) The documentation often leaves much to be desired. Frankly, documentation usually does. But since Cordova is open-source, if there's a pain point you think can be improved, you're welcome to contribute.
7) Cordova's release schedule often feels /frantic/, granted. That said, I'm encouraged by the fact there's so much work going on into the project. It could be a lot worse, you know! There are stated goals, as well, to reduce breakages, but sometimes breakages /just happen/ (either a bug in the code, a missed test, etc.) For example, there was a bug in the File API that broke copying files from the temporary file system to the persistent file system. It finally got fixed, and it was frustrating at the time, yes, but it was not an intentional break. 
8) I've not yet encountered a problem with the status bar plugin, so I can't help there. But try #2 to see if the error goes away.

There's plenty of other alternatives to PG out there -- I won't list them here -- a google search should suffice. I don't know that any are any more mature than PG is, and they all have their pain points, as far as I can see. There's no project that doesn't, especially when the mobile space is changing so quickly. We are, in a sense, on the bleeding edge here, and it shouldn't come as a surprise when things go askew.

Rob Lauer

unread,
Apr 28, 2014, 4:41:27 PM4/28/14
to phon...@googlegroups.com
Full disclaimer: I am Product Manager for Telerik AppBuilder.

If your biggest frustrations with Cordova surround tooling and upgrading versions, I highly suggest you take a look at AppBuilder. It provides the build services (like PG Build) but also access to five different IDEs (browser client, Windows client, Sublime Text package, Visual Studio extension, and a CLI), a really great device simulator, on-device debugging, etc.

We at Telerik have much love for the Cordova team, and I think we all realize that on-boarding and tooling are still a major issue for Cordova developers. Take a look and I'd love to hear your feedback.

Rob

SBCERA

unread,
Apr 29, 2014, 4:36:54 PM4/29/14
to phon...@googlegroups.com
Having to use DNN, which uses Telerik, is the worst experience ever. So much so that I wouldn't touch Telerik with a ten foot pole even though I have no idea what their AppBuilder does.

The Cordova path has been a difficult one for sure. I came on way early too and every upgrade has been a hair puller. I would agree with the frustrations, but would add that the developers have been helpful and the community is pretty robust(go look for a DNN community).

Unsolicited 2 cents over.

Steve Sobol - Lobos Studios

unread,
Apr 29, 2014, 5:22:02 PM4/29/14
to phon...@googlegroups.com
I'm not worried about contributing to PhoneGap. Is there really any functional difference anymore?

I think that is part of the problem people have with Cordova. What's Cordova? What's PhoneGap? We have (among other things) a brand identity problem!

Here's how I see it, and you are welcome to correct me if I'm wrong. PhoneGap is a private-branded fork of Cordova for which Adobe offers automated build tools. PhoneGap seems (to me) to be similar to products offered by Intel, Telerik and.... I forget which company is responsible for Appcelerator.  :) The difference would be that PhoneGap is a commercial offering built *mostly* on top of Cordova, where the other products may not be.

Am I at least partially correct?

These are things that need to be defined going forward. I'm working with Cordova now, without any real issues, but on new projects. 99% of the problems I see reported here are with projects that are being upgraded from an earlier version of PhoneGap (typically 2.x to 3.x). I'm not having those problems because I'm not migrating old projects.

Part of the documentation NEEDS to include a COHERENT, USABLE migration guide. I want to write one, but I'll need help from people who are having problems migrating their projects.

It's been WAY too long since the last time I contributed to any open-source projects, anyhow. This is a good place to (re-)start.

Also, Shazron, you sent me an email with a couple more details about contributing to the docs, but I think I deleted it, and it was sent only to me, not to the list. Could you re-send it please? I don't remember your Gmail address... or your Adobe address, otherwise I would have sent this request directly to you.

Thanks, guys. I'm looking forward to working on Cordova.
Reply all
Reply to author
Forward
0 new messages