Random thoughts & observations

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

Resolving CUSTOM_ELEMENTS_SCHEMA error with unit testing Angular 7 components

Resolving CUSTOM_ELEMENTS_SCHEMA error with unit testing Angular 7 components

Posted: Thursday 21st March, 2019 - 9:09pm
Author: James Griffiths

Created custom components with your Angular 6/7 applications and finding your unit tests failing with the following error(s):

'mi-accordion' is not a known element:
1. If 'mi-accordion' is an Angular component, then verify that it is part of this module.
2. If 'mi-accordion' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component

Here's how to fix that...

Read more...
Setting equal height columns in CSS Grid layouts

Setting equal height columns in CSS Grid layouts

Posted: Saturday 9th March, 2019 - 1:16pm
Author: James Griffiths

CSS Grid (for those browsers that support the feature) makes page layout easier, faster and more flexible than previous front-end development techniques.

If you're struggling with using CSS Grid to render a layout where all columns share the same height then read on... 

Read more...

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...
Page 1 of 9