Random thoughts & observations

From the mundane to the profound and everything in between here’s what’s rocking our world

zipalign command not found for Android APK publishing

Posted: Monday 18th April, 2016 - 7:39pm
Author: James Griffiths

Developing Ionic Apps for Android solely from the command line? Receiving the following error when trying to run the zipalign utility?

-bash: zipalign: command not found

Assuming you're using a unix based OS here's how to fix this...

Read more...

Resolving Xcode CFBundleIcons no image found error

Posted: Thursday 14th April, 2016 - 7:33pm
Author: James Griffiths

Xcode is pretty great for a free piece of software BUT that doesn't mean it's without its quirks.

One of those that we encountered recently was the following message when attempting to submit an archived package to the Apple App Store:

ERROR ITMS-90032:“Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': icon.png”

Not the kind of warning you expect to see after optimising your App and providing all the necessary launch icons and splash screens - even more so AFTER the App had passed validation - so what was causing this?

Read more...

Solving Ionic Android App error with no Java files found which extend CordovaActivity

Posted: Tuesday 12th April, 2016 - 7:28pm
Author: James Griffiths

If you're developing an Android App using the Apache Cordova and Ionic Framework tools and encounter the following error:

Error: No Java files found which extend CordovaActivity

When trying to deploy your App to a connected device with the following command:

ionic run android

Then the solution might seem a little bit radical but, is in fact, quite quick and easy to implement...

Read more...

Performing batch transactions in WebSQL on iOS & Android

Posted: Thursday 7th April, 2016 - 7:24pm
Author: James Griffiths

Despite being a deprecated standard and with certain developer resistance to using WebSQL we still find it to be a fantastic database solution for storing data cross-platform on both iOS & Android.

With a recent App we were developing we needed to be able to run batch transactions on inserting arrays of data into the SQLite database tables. Our solution for iOS worked perfectly but we didn't realise this would NOT work on Android (but fortunately found a workaround to accomplishing the same goal).

Let's have a look at the iOS solution and find out why.

Read more...

Resolving Ionic App invalid character entity warning on Android

Posted: Thursday 7th April, 2016 - 7:20pm
Author: James Griffiths

Here's an interesting error we came across when publishing a recent App to an Android device:

Error happened [Error: Invalid character entity
Line: 4
Column: 56
Char:  ]
Error: Invalid character entity
Line: 4
Column: 56
Char:  
    at error (/usr/local/lib/node_modules/ionic/node_modules/xml2js/node_modules/sax/lib/sax.js:642:8)
    at strictFail (/usr/local/lib/node_modules/ionic/node_modules/xml2js/node_modules/sax/lib/sax.js:662:22)
    at Object.write (/usr/local/lib/node_modules/ionic/node_modules/xml2js/node_modules/sax/lib/sax.js:1336:11)
    at Parser.exports.Parser.Parser.parseString (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:403:31)
    at Parser.parseString (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:6:61)
    at Object.exports.parseString (/usr/local/lib/node_modules/ionic/node_modules/xml2js/lib/xml2js.js:433:19)
    at /usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/config-xml.js:23:12
    at /usr/local/lib/node_modules/ionic/node_modules/ionic-cordova-lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:76:16
    at fs.js:336:14
    at /usr/local/lib/node_modules/ionic/node_modules/ionic-cordova-lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:42:10

Yikes!

If you are currently encountering this error you will not believe how (thankfully) simple the solution to fixing this is...

Read more...

Resolving permissions error for Apache Cordova command line usage

Posted: Tuesday 29th March, 2016 - 7:12pm
Author: James Griffiths

We found, after a recent Apache Cordova upgrade, that every time we tried to run Cordova commands in the Terminal we'd receive the following error message:

/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:53
				throw err;
				      ^
Error: EACCES, permission denied '/Users/name-here/.config/configstore/update-notifier-cordova.json'
You don't have access to this file.

    at Error (native)
    at Object.fs.openSync (fs.js:502:18)
    at Object.fs.readFileSync (fs.js:354:15)
    at Object.create.all.get (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:34:26)
    at Object.Configstore (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/node_modules/configstore/index.js:27:44)
    at new UpdateNotifier (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:34:17)
    at module.exports (/usr/local/lib/node_modules/cordova/node_modules/update-notifier/index.js:123:23)
    at checkForUpdates (/usr/local/lib/node_modules/cordova/src/cli.js:64:20)
    at cli (/usr/local/lib/node_modules/cordova/src/cli.js:116:5)
    at Object. (/usr/local/lib/node_modules/cordova/bin/cordova:41:1)

Definitely not a good sign!

Thankfully, fixing this is quite straightforward...

Read more...

Resolving cannot find NPM module error when installing cordova plugins

Posted: Friday 25th March, 2016 - 7:08pm
Author: James Griffiths

After updating both the local Ionic and Cordova versions for an iOS project we encountered the following error while attempting to install some Cordova plugins from the command line:

module.js:340
    throw err;
          ^
Error: Cannot find module 'bplist-parser'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object. (/Users/joebloggs/.nvm/v0.10.26/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:20:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Not a good sign!

Thankfully the fix to this takes less than a few seconds to implement...

Read more...

Viewing Gulp tasks from the command line

Posted: Thursday 24th March, 2016 - 7:03pm
Author: James Griffiths

There's no denying that front-end development workflow has been improved greatly with tasks runners such as Grunt and Gulp.

Here's a nice little tip on being able to view all Gulp related tasks directly from the command line...

Read more...

Suppressing JSHint mixed spaces and tabs warning

Posted: Thursday 24th March, 2016 - 7:01pm
Author: James Griffiths

If you've been using JSHint for an extended period of time you may have encountered warnings being printed to the console akin to the following:

scripts.js: line 23, col 1, Mixed spaces and tabs.
scripts.js: line 44, col 1, Mixed spaces and tabs.

This warning occurs as JSHint will not allow spaces and tabs to be used together.

Switching this off is quite easy...

Read more...

Fixing Xcode 7.2 issue with Missing iOS Distribution signing identity error

Posted: Tuesday 23rd February, 2016 - 6:56pm
Author: James Griffiths

Here's another Xcode 7.2 error we encountered while attempting to validate an iOS archive prior to submission to the Apple App store:

Failed to locate or generate matching signing assets

Xcode attempted to locate or generate matching signing assets and failed 
to do so because of the following issues.

Missing iOS Distribution signing identity for ... Xcode can request one for you.

Fixing this is, thankfully, quite easy...

Read more...

Resolving Xcode 7.2 issue with Cordova CDVViewController.h file not found

Posted: Monday 22nd February, 2016 - 6:52pm
Author: James Griffiths

If you're using Cordova PhoneGap and have recently upgraded to Xcode 7.2 you might be experiencing the following build error when attempting to create an archive for submission to the Apple App store:

Cordova/CDVViewController.h file not found

It's an odd one because you've double checked your software installation; PhoneGap and Xcode are up to date and you can publish the app to an iOS device for testing without issue.

As this only happens when creating archives for app submissions the error doesn't seem to make any sense whatsoever.

Thankfully the solution is incredibly simple to implement...

Read more...

Dealing with Git unlink file errors

Posted: Wednesday 17th February, 2016 - 6:45pm
Author: James Griffiths

Chances are when using Git for your version management needs you may have encountered an error warning in the terminal similar to the following:

Counting objects: 2106547, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (269562/269562), done.
Writing objects: 100% (2106547/2106547), done.
Total 2106547 (delta 636114), reused 2106547 (delta 636114)
Unlink of file '.git/objects/pack/pack-105e2cad4265551672452c ... 5127bac40.pack'
    failed. Should I try again? (y/n)

Pretty annoying right?

Fixing this is actually pretty simple...

Read more...

Exploring ECMAScript 6 - Array manipulation

Posted: Saturday 6th February, 2016 - 6:38pm
Author: James Griffiths

ECMAScript 6, commonly referred to as ES6, is the latest ECMAScript language specification that defines the standards for implementing JavaScript in web browsers. ES6brings with it lots of powerful new features that provide developers with more flexibility than ever when crafting their applications.

In the following article we're going to take a look at manipulating arrays in ES6.

Read more...
Page 1 of 8