Google Analytics with Ionic

I am trying to add Google Analytics to an Ionic / phonegap / Covdova app using this . However, I am getting the following errors:

There was a problem setting the root project 'android'. Failed to resolve all dependencies for configuration: _debugCompile. Could not find a version compatible with com.google.android.gms: play-service S-analytics: +. Search in the following locations:           https://repo1.maven.org/maven2/com/google/android/gms/play-services-ana lytics / Maven-metadata.xml           https://repo1.maven.org/maven2/com / google / android / gms / play-services-ana lytics / Required:: Android: not defined

I have Android SDK and Google Play installed. I even try to use the older version mentioned in the doc: cordova plugin add cordova-plugin-google-analytics@0.7.1

but that gives the same error.

+3


source to share


2 answers


I had the same problem and found the answer in this comment .

Run android

and then install / update

  • Android Support Repository
  • Android Support Library
  • Google Play Services
  • Google storage

fixed the problem for me.



It looks like several people also had to change the plugin version

cordova plugin add cordova-plugin-google-analytics@0.7.1

      

but I shouldn't have done that.

+3


source


try to remove the platform and add it again,

ionic platform rm android

ionic platform add android

      



this trick worked for me.

0


source







All Articles