Google Analytics with Ionic

2019-05-11 20:28发布

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

A problem occurred configuring root project 'android'. Could not resolve all dependencies for configuration ':_debugCompile'. Could not find any version that matches com.google.android.gms:play-service s-analytics:+. Searched 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 by: :android:unspecified

I have Android SDK and Google Play service installed. I even try to use the older version it mentioned in the document: cordova plugin add cordova-plugin-google-analytics@0.7.1 but that gives the same error.

2条回答
兄弟一词,经得起流年.
2楼-- · 2019-05-11 20:58

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

Running android and then installing/updating

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

fixed the problem for me.

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

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

but I didn't have to do this.

查看更多
Evening l夕情丶
3楼-- · 2019-05-11 21:15

try removing platform and add it again,

ionic platform rm android

ionic platform add android

this trick worked for me.

查看更多
登录 后发表回答