cmackay / google-analytics-plugin

Cordova Google Analytics Plugin for Android & iOS
Apache License 2.0
89 stars 43 forks source link

more than one library with package name 'com.google.android.gms' #49

Closed Ziv-Barber closed 8 years ago

Ziv-Barber commented 9 years ago

Anyone managed to find a solution to the com.google.playservices problem?

cmackay commented 9 years ago

I don't get this error. Do you have any more details on this? Are you using the latest version of the plugin?

Thanks,

-Craig

pacotole commented 9 years ago

The problem is when use the plugin with others plugins that use google play services also.

How you can replicate the problem (e.g. onesignal plugin uses Google GCM):

cordova create workshop com.yourname.workshop Workshop
cd workshop
cordova platform add android
cordova plugin add com.cmackay.plugins.googleanalytics
cordova plugin add onesignal-cordova-plugin
cordova build --debug android
pacotole commented 9 years ago

The problem is that are two versions of com.google.android.gms

I solved it editing plugin.xml in all plugins that use Google Play Services and set tags <framework src="com.google.android.gms:service-name:XXX" /> to the last version (8.1.0)

https://developers.google.com/android/guides/setup

After clean gradle files:

cordova platforms rm android
cordova platforms add android
Ziv-Barber commented 9 years ago

The problem is that adding the plugin google play services make 2 compilation lines inside the gradle.build file. The additional problem is that every time that you build something adding this line again into gradle.build. The work around is to edit gradle.build:

  1. Find and remove the compile line for google play services
  2. Remove the two comments just above and below this line to prevent cordova to add this line again.

On Fri, Oct 23, 2015 at 9:21 AM, Pacotole notifications@github.com wrote:

The problem is that are two versions of com.google.android.gms

I solved it editing plugin.xml in all plugins that use Google Play Services and set tags <framework src="com.google.android.gms:service-name:XXX" /> to the last version (8.1.0)

https://developers.google.com/android/guides/setup

After clean gradle files:

cordova platforms rm android cordova platforms add android

— Reply to this email directly or view it on GitHub https://github.com/cmackay/google-analytics-plugin/issues/49#issuecomment-150495941 .

petarov commented 9 years ago

@Ziv-Barber Are you using a plugin that does not make use of the <framework> tag as @pacotole suggested? This is the most common reason for this problem.

cmackay commented 8 years ago

I am closing this. When I tested this I wasn't able to reproduce this. It appears to be the issue both @pacotole and @petarov suggested. If there are more details, feel free to reopen. Thanks!