Plugin_not_installed error with GoogleAnalytics analytics plugin


I’m trying to use the plugin in an Ionic 2 app. This is my ionic info output for the versions of all the components I’m using:

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS
Node Version: v6.7.0

When I call startTrackerWithId inside my platform.ready(), I’m getting a plugin_not_installed error inside my enableUncaughtExceptionReporting handling.

I also see this output in the logcat output:

11-25 13:56:04.791 4990 4990 I chromium: [INFO:CONSOLE(93226)] “Native: tried calling GoogleAnalytics.trackView, but the GoogleAnalytics plugin is not installed.”, source: file:///android_asset/www/build/js/app.bundle.js (93226)
11-25 13:56:04.791 4990 4990 I chromium: [INFO:CONSOLE(93231)] “Install the GoogleAnalytics plugin: ‘ionic plugin add cordova-plugin-google-analytics’”, source: file:///android_asset/www/build/js/app.bundle.js (93231)

However, it is installed as can be seen when I run ionic plugins:

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

Also, I have installed the google play services with the SDK manager.

I tried reinstalling the plugin several times as well as adding and removing the android platform, no success.

What am I missing? :frowning:


I just found the problem. I was including the cordova.js file last in my index.html, but it had to be first.