Random thoughts & observations

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

Xcode error with no JSON request provided in the payload

Posted: May 8, 2016
Written by: Saints At Play
Category: Apple

Xcode and its strange quirks keep errors coming thick and fast when its time to submit archives to the Apple App Store.

Here's an interesting one related to JSON requests:

Xcode no JSON payload error warning

The solution?

More »

Fixing Xcode error with iPad multitasking support requires these orientations warning

Posted: May 8, 2016
Written by: Saints At Play
Category: Apple

Here's a new Xcode error we came across when attempting to submit an archive to the Apple App Store:

Xcode iPad error warning

This one confused us at first because we had selected the orientations for how the App would be displayed in our project settings file.

The solution is, however, absurdly simple...

More »

zipalign command not found for Android APK publishing

Posted: April 18, 2016
Written by: Saints At Play
Category: Android

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...

More »

Resolving Xcode CFBundleIcons no image found error

Posted: April 14, 2016
Written by: Saints At Play
Category: Apple

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?

More »

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

Posted: April 12, 2016
Written by: Saints At Play
Category: Ionic Framework

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...

More »

Performing batch transactions in WebSQL on iOS & Android

Posted: April 7, 2016
Written by: Saints At Play
Category: HTML5

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.

More »

Resolving Ionic App invalid character entity warning on Android

Posted: April 7, 2016
Written by: Saints At Play
Category: Ionic Framework

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...

More »

Resolving permissions error for Apache Cordova command line usage

Posted: March 29, 2016
Written by: Saints At Play
Category: PhoneGap

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...

More »

Resolving cannot find NPM module error when installing cordova plugins

Posted: March 25, 2016
Written by: Saints At Play
Category: Node JS

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...

More »

Viewing Gulp tasks from the command line

Posted: March 24, 2016
Written by: Saints At Play
Category: Gulp

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...

More »

Suppressing JSHint mixed spaces and tabs warning

Posted: March 24, 2016
Written by: Saints At Play
Category: Gulp

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...

More »

Fixing Xcode 7.2 issue with Missing iOS Distribution signing identity error

Posted: February 23, 2016
Written by: Saints At Play
Category: Apple

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...

More »

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

Posted: February 22, 2016
Written by: Saints At Play
Category: Apple

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...

More »

Dealing with Git unlink file errors

Posted: February 17, 2016
Written by: Saints At Play

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...

More »

Exploring ECMAScript 6 - Array manipulation

Posted: February 6, 2016
Written by: Saints At Play
Category: Javascript

ECMAScript 6, commonly referred to as ES6, is the latest ECMAScript language specification that defines the standards for implementing JavaScript in web browsers. ES6 brings 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.

More »

Remove an item from a JavaScript array by value

Posted: February 1, 2016
Written by: Saints At Play
Category: Javascript

No matter how much you work with a given tool there will always be those 'aha' moments when you learn something new that you didn't realise was possible before.

One of those 'aha' moments was when we discovered the filter method in JavaScript.

More »

Using the revealing prototype pattern in JavaScript

Posted: January 30, 2016
Written by: Saints At Play
Category: Javascript

When developing applications with JavaScript you quickly realise the need to architect and structure your code in a way that's modular, scalable and efficient.

Due to JavaScript's flexibility there are many ways this could be achieved; some better than others.

In this article we're going to take a look at how this could be achieved using the revealing prototype pattern and discuss the benefits and drawbacks of this particular design pattern...

More »

5 Ways to keep your Mac laptop from overheating

Posted: January 13, 2016
Written by: Saints At Play
Category: Apple

Mac laptops are generally quite reliable but, like any equipment, they can develop faults and, if not properly maintained, are likely to become prone to frequent problems later on.

One of those problems may involve overheating.

Here are 5 steps you can take to minimise and reduce overheating on your Mac laptop...

More »

Preventing Mac laptop overheating with resource intensive processes in El Capitan OS X

Posted: January 12, 2016
Written by: Saints At Play
Category: Apple

If you've upgraded to El Capitan and found your Mac laptop getting ridiculously hot after a short amount of time - EVERY time you use it - then here's how to help solve this (very serious) issue...

More »

Updating a range of records with MySQL

Posted: January 8, 2016
Written by: Saints At Play
Category: Server

Updating a single record entry in a MySQL database table is fairly simple, but what if you need to update a batch of records with one single query?

It's not as difficult as you might think...

More »

Removing the back button text in Ionic Framework Apps

Posted: December 27, 2015
Written by: Saints At Play
Category: Ionic Framework

There's no doubt that the Ionic Framework makes developing Mobile Apps easier to accomplish but as great as the framework is the documentation can sometimes be a little lacking.

This is especially true where it comes to figuring out how to hide the back button text in iOS Apps.

More »

htaccess rules for Perch CMS

Posted: December 23, 2015
Written by: Saints At Play
Category: Perch CMS

Perch CMS makes content management for small business clients a cinch.

The following htaccess rules help you get Perch CMS to load your website without interfering with accessing the admin console...

More »

Undoing a local Git merge

Posted: December 10, 2015
Written by: Saints At Play

Git is a fantastic tool for managing project code within a team context but, as with any tool, there'll always be occasions when you run into problems.

One such problem might occur where you want to undo a local branch merge that hasn't been pushed to the remote repository. Sounds tricky right?

The following are ways in which this can be accomplished relatively quickly...

More »

Resolving iOS9 page transition issues with Ionic Framework Apps

Posted: November 18, 2015
Written by: Saints At Play
Category: Ionic Framework

If you've recently upgraded to iOS 9 you might find an issue with your Ionic Apps when testing/running on native devices.

We found that using the ui-router logic resulted in navigation issues where the requested page would 'flicker' or 'jerk' slightly into view before sliding back and then finally transitioning into full view.

Not a very pleasant user experience but thankfully the Angular team have rolled out a fix for this particular bug that we can implement in our Ionic Apps for now.

More »

Managing Cordova PhoneGap plugins from the command line

Posted: November 13, 2015
Written by: Saints At Play
Category: PhoneGap

In the following mini-tutorial we'll look at how easy it is to add, find, list and remove plugins for Cordova PhoneGap projects using the command line.

We are going to assume that you have the following software installed on your system:

It's also assumed that you have some familiarity with using the command line.

If you can answer yes to all of the above let's get started!

More »

Storing and retrieving objects with LocalStorage

Posted: October 21, 2015
Written by: Saints At Play
Category: HTML5

The HTML5 Web Storage API provides developers with greater latitude for front-end storage compared to that of cookies, particularly with the localStorage property, making this an excellent choice for managing data within web and mobile applications.

Aside from browser support one issue with using this API is that data saved within localStorage can be of only 2 types: strings or integers.

So where does this leave us with other data types such as Objects and Arrays?

More »

Converting between dates and timestamps in JavaScript

Posted: October 14, 2015
Written by: Saints At Play
Category: Javascript

Managing the conversion between dates and timestamps is relatively easy in JavaScript.

More »

Embedding YouTube Videos in Ionic Apps

Posted: October 12, 2015
Written by: Saints At Play
Category: Ionic Framework

In this article we're going to take you through embedding a YouTube video within an Ionic App.

We are going to assume that you have the following software installed on your system (we are using Mac OS X - so some screengrabs may differ to what you see on your own system):

It's also assumed that you have some familiarity developing with AngularJS too.

If you can tick all of the above then let's get started!

More »

Generating JSON objects dynamically in JavaScript

Posted: September 26, 2015
Written by: Saints At Play
Category: Javascript

Working with JSON provides front-end developers with many advantages over other data formats, least of which is the fact that it's a subset of the JavaScript language itself.

In this short tutorial we'll take you through dynamically generating a JSON object within JavaScript...

More »

Converting between dates and timestamps in PHP

Posted: September 23, 2015
Written by: Saints At Play
Category: Server

There may be occasion, when working in PHP, that you need to convert date related values between date type formats and timestamps.

PHP makes that incredibly easy to accomplish.

More »

Solving JSON encode error Invalid UTF-8 sequence in argument in PHP

Posted: September 20, 2015
Written by: Saints At Play
Category: Server

We've recently been working on some PHP coding to generate JSON output drawn from a variety of MySQL database tables and hit the following error: json_encode(): Invalid UTF-8 sequence in argument.

Solving this was, thankfully, relatively quick and easy...

More »

Understanding the JavaScript revealing module pattern

Posted: September 12, 2015
Written by: Saints At Play
Category: Javascript

As our JavaScript applications start to become more complex and demanding it makes sense to turn towards using specific design patterns as a way of managing those needs. In this particular article we're going to take a look at one particular design pattern: the revealing module.

More »

JavaScript namespacing and modules

Posted: September 12, 2015
Written by: Saints At Play
Category: Javascript

As JavaScript has, at the current time of writing, no native support for namespaces we, as developers, have to implement our own approaches/solutions to avoid polluting the global namespace with objects/methods and variables that might conflict with/overwrite one another if we are not careful.

In this article we take you through using namespaces and modules to better manage your code.

More »

Measuring Javascript performance and debugging with browser inspector tools

Posted: September 4, 2015
Written by: Saints At Play
Category: Javascript

As JavaScript has become a central pillar of front-end web development, thanks to modern browser support, the tools we need to measure how our scripts are performing have become increasingly important.

In this article we're going to take a look at some of these tools that are available directly within the Google Chrome browser...

More »

Useful PHP Composer functions

Posted: August 30, 2015
Written by: Saints At Play
Category: Server

Thanks, in recent years, to the introduction of Composer managing package dependencies for PHP has become much easier, quicker and far less stressful. The following are some Composer essentials that all PHP developers should be familiar with...

More »

Upgrading PHP installation on Mac OS X Mavericks

Posted: August 23, 2015
Written by: Saints At Play
Category: Server

One of the great things about Mac OS X for developers?

The sheer amount of built-in, open source technologies available by defaultApache, Bash, Curl, Emacs, Nano, Perl, PHP, Python and Ruby to name but a handful. 

In this article we'll guide you through bypassing the version of PHP installed by default on Mavericks and using a different binary instead.

More »

Installing PyroCMS 3 Beta

Posted: August 15, 2015
Written by: Saints At Play
Category: PyroCMS

PyroCMS is, without the shadow of a doubt, our numero-uno choice of CMS for all web development related work, whether it be private or client related, and we've been looking forward to getting our hands on version 3 of the software.

Built from the ground up with Laravel the recent beta release of PyroCMS v3 gave us the opportunity to test out our favourite CMS solution.

More »

Resolving CORS issues with Ajax requests

Posted: July 26, 2015
Written by: Saints At Play
Category: Javascript

Ajax makes life as a web developer a lot easier, particularly when used with a framework such as jQuery but, like all development related technologies, there will always be gotchas that can catch you unawares.

One of those is CORS...

More »

Resolving AngularJS executing controller twice issue

Posted: June 28, 2015
Written by: Saints At Play
Category: AngularJS

If you've been developing with AngularJS for some time then you may have unwittingly come across the following issue: your controller is executed twice.

Seems like one of those coding problems that shouldn't exist but fixing this is, thankfully, quite simple...

More »

Increasing MongoDB soft rlimits on Mac OS X

Posted: May 18, 2015
Written by: Saints At Play
Category: MongoDB

If you've installed MongoDB on Mac OS X (and this will more than likely be applicable to similar UNIX based systems such as Linux) you may be greeted with the following warning when running the mongo daemon process in your Terminal application:

** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

Looks a little cryptic doesn't it? Let's take a look at what this means and how to fix it...

More »

Resolving MongoDB lock error

Posted: May 17, 2015
Written by: Saints At Play
Category: MongoDB

If you've been exploring the MEAN Stack (MongoDB, ExpressJS, AngularJS and Node.....for those not in the know!) you may have encountered the following problem when attempting to start MongoDB from the command line:

old lock file: /data/db/mongod.lock.  probably means unclean shutdown,
but there are no journal files to recover.
this is likely human error or filesystem corruption.
please make sure that your journal directory is mounted.

Resolving this issue is relatively straightforward...

More »

CSS zebra striping table rows

Posted: May 9, 2015
Written by: Saints At Play
Category: CSS

One of the great things about modern browser support for web standards is the amount of really cool things that become so much simpler to do than before.

Case in point: alternating the striping of table rows, lists etc - also known as zebra striping.

With CSS this now becomes almost trivial.

If you're using a pre-processor such as Sass (and if you're not you really should think about investing the time to implement this tool into your development process as it will completely change how you write your CSS....for the better) you can accomplish row striping with the following snippet:

More »

Resolving Gulp libsass error

Posted: April 29, 2015
Written by: Saints At Play
Category: Gulp

If you've recently updated the Gulp task runner program you might encounter the following error with a previously working installation of gulp-sass:

/Users/whatever-your-user-directory-is-called/project-directory/gulp/node_modules/gulp-sass/node_modules/node-sass/sass.js:22
throw new Error('`libsass` bindings not found. Try reinstalling `node-sass`?

We found the following fixed the issue, allowing for Gulp to process Sass as it had done prior to the update.

More »

Preventing text scaling on iPhone landscape orientation change

Posted: April 25, 2015
Written by: Saints At Play
Category: CSS

You may have come across the following issue while developing responsive websites: you're testing your finely crafted pages on an iPhone and change to a landscape orientation only to find your page text has suddenly increased in size.

No, you didn't do anything wrong: it's simply a quirk of text rendering on Webkit, Gecko & Trident based smartphones and the fix is surprisingly simple.

More »

Hiding default spinner buttons on HTML number input fields

Posted: April 18, 2015
Written by: Saints At Play
Category: HTML5

If you've been exploring HTML5 (and there's no good reason why you shouldn't be) you're probably familiar with the range of form enhancements that this recent upgrade to the language brings with it, in particular those concerning additional input field types.

If this is the case then you might also be familiar with certain browsers adding default controls to the number input field.

Thankfully these can also be removed - with only a smidgen of CSS.

More »

Customising a form select menu with CSS

Posted: April 11, 2015
Written by: Saints At Play
Category: CSS

CSS, when combined with modern browser support for the latest technologies, allows front-end developers a wider palette of options for crafting website and app interfaces than was possible 10 years ago. In this short tutorial we'll take you through how to customise a standard HTML select menu using nothing more complicated than CSS.

More »

Hiding the jQuery UI datepicker on form field exit

Posted: March 21, 2015
Written by: Saints At Play
Category: jQuery UI

If you've been implementing the jQuery UI datepicker component in your projects you may have encountered an issue with the datepicker not closing when exiting the parent field or clicking outside the widget.

More »

Resolving node module did not self register errors

Posted: March 15, 2015
Written by: Saints At Play
Category: Node JS

If you've recently updated your existing Node installation to v0.12 and have success with starting your server then congratulations. However it might be the case that you are experiencing the following error warning when trying to launch your Express Framework application from the command line:

[Error: Module did not self-register.]

Not the best result right? Here's how we resolved the issue and got our Express apps working again.

More »

Resolving npm ERR! cb() never called errors

Posted: March 14, 2015
Written by: Saints At Play
Category: Node JS

This was one extremely annoying error that we kept encountering when trying to update existing node packages using the Node Package Manager from the command line:

npm ERR! cb() never called!

After much googling (interrupted by intermittent bouts of swearing at the computer) we finally found a solution to the problem.

More »

Ionic framework attempt to unlock file that has not been locked error

Posted: March 14, 2015
Written by: Saints At Play
Category: Ionic Framework

Here's a frustrating issue we encountered when trying to update the ionic framework with the following command:

sudo npm update -g ionic

Instead of seeing a list of updated components being displayed in the console the following error occurred:

npm WARN locking Error: EACCES, open '/Users/nameHere/.npm/_locks/ionic-61c0cd50dc7a1457.lock'
npm WARN locking     at Error (native)
npm WARN locking  /Users/nameHere/.npm/_locks/ionic-61c0cd50dc7a1457.lock failed { [Error: EACCES, open '/Users/nameHere/.npm/_locks/ionic-61c0cd50dc7a1457.lock']
npm WARN locking   errno: -13,
npm WARN locking   code: 'EACCES',
npm WARN locking   path: '/Users/nameHere/.npm/_locks/ionic-61c0cd50dc7a1457.lock' }
npm ERR! Darwin 13.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "update" "-g" "ionic"
npm ERR! node v0.12.0
npm ERR! npm  v2.7.1

npm ERR! Attempt to unlock /usr/local/lib/node_modules/ionic, which hasn't been locked

Not the most welcome of sights is it? Thankfully solving this turned out to be relatively quick and easy.

More »

Latest Tweets