Unknown provider: googleAnalyticsProvider <- googleAnalytics


I have a project that is using cordova-plugin-google-analytics plugin with Ionic framework.
I switched to a new Linux system after working on OS X for a couple of months.

On the old system the project runs flawlessly but on the new system I can’t get it started.
The code is identical on both systems and no changes have been made.

I’m trying to run the development environment with the ionic serve command and the client console throws me the following exception:

4     836947   error    Uncaught Error: [$injector:unpr] Unknown provider: googleAnalyticsProvider <- googleAnalytics
http://errors.angularjs.org/1.4.3/$injector/unpr?p0=googleAnalyticsProvider%20%3C-%20googleAnalytics,, Line: 13241

The plugin version is:

cordova-plugin-google-analytics 1.7.4 “Google Universal Analytics Plugin”

I also tried using version 0.8.1 (That is working on my old system)


var Analytics;

Analytics = function($cordovaGoogleAnalytics) {
  this.setTrackerWithId = function(trackId) {
    return document.addEventListener("deviceready", (function() {
    }), false);
  this.setTrackView = function(screenTitle) {
    return document.addEventListener("deviceready", (function() {
    }), false);
  return void 0;

angular.module('stCommons').service('googleAnalytics', Analytics);
  • Tried to remove and add the plugin
  • Tried to remove and add the platforms


System info:

Cordova CLI: 6.5.0 
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.5.0
Xcode version: Not installed

use this plugin