I'm getting an error when trying to build my ionic app for android. It throws an error: Error: more than one library with package name 'com.google.android.gms'
and I can't figure out what combination of plugins is causing it. What plugins are causing the issue and what can I do about it? Thanks!
Output of ionic plugin list
:
cc.fovea.cordova.purchase 3.11.0 "Purchase"
com.google.playservices 21.0.0 "Google Play Services for Android"
com.ionic.keyboard 1.0.4 "Keyboard"
com.phonegap.plugins.PushPlugin 2.5.8 "PushPlugin"
com.phonegap.plugins.facebookconnect 0.11.2 "Facebook"
com.verso.cordova.clipboard 0.1.0 "Clipboard"
cordova-plugin-camera 1.2.0 "Camera"
cordova-plugin-console 1.0.1 "Console"
cordova-plugin-crosswalk-webview 1.2.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.0.1 "Device"
cordova-plugin-file 2.1.0 "File"
cordova-plugin-file-transfer 1.2.0 "File Transfer"
cordova-plugin-geolocation 1.0.1 "Geolocation"
cordova-plugin-google-analytics 0.8.0 "Google Universal Analytics Plugin"
cordova-plugin-inappbrowser 1.0.1-dev "InAppBrowser"
cordova-plugin-network-information 1.0.1 "Network Information"
cordova-plugin-splashscreen 2.0.1-dev "Splashscreen"
cordova-plugin-statusbar 1.0.1 "StatusBar"
cordova-plugin-whitelist 1.0.0 "Whitelist"
org.apache.cordova.globalization 0.3.4 "Globalization"
twitter-connect-plugin 0.4.0 "Twitter Connect"
Woo! I was able to fix it.
build-extras.gradle
file in the same folder as your build.gradle.Fill it with this:
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.google.android.gms', module: 'play-services-analytics'
}
The second line is related to this error, the first line fixes a similar issue.