我在尝试为Android构建我的离子应用程序时遇到错误。它抛出一个错误:Error: more than one library with package name 'com.google.android.gms'
,我无法弄清楚插件的组合是什么造成的。什么插件导致了这个问题,我该怎么办呢?谢谢!
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"
答案 0 :(得分:3)
呜!我能够解决它。
build-extras.gradle
文件。填写:
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
all*.exclude group: 'com.google.android.gms', module: 'play-services-analytics'
}
第二行与此错误有关,第一行修复了类似的问题。
答案 1 :(得分:0)
运行./gradlew :app:dependencies
并查看正在使用com.google.android.gms
的软件包。然后将其排除在一个或多个依赖项之外:
compile('some_package') {
exclude group: 'com.google.android.gms', module: 'some_module'
}