Ionic(cordova):Gradle:包含名称为“com.google.android.gms”

时间:2015-09-14 14:55:00

标签: android cordova ionic build.gradle

我在执行Ionic运行android时遇到错误,这里是错误

  

错误:包含名称为“com.google.android.gms”的多个库   您可以使用android.enforceUniquePackageName = fal暂时禁用此错误   SE   但是,这是暂时的,将在1.0`

中强制执行

以下是我添加的插件

com.google.playservices 21.0.1 "Google Play Services for Android"
com.ionic.keyboard 1.0.4 "Keyboard"
com.phonegap.plugins.facebookconnect 0.11.0 "Facebook Connect"com.transistorsoft.cordova.background-geolocation 0.5.11 "BackgroundGeolocation"
cordova-plugin-camera 1.2.0 "Camera"
cordova-plugin-console 1.0.1 "Console"
cordova-plugin-device 1.0.1 "Device"
cordova-plugin-dialogs 1.1.1 "Notification"
cordova-plugin-file 2.1.0 "File"
cordova-plugin-file-transfer 1.2.1 "File Transfer"
cordova-plugin-geolocation 1.0.1 "Geolocation"
cordova-plugin-network-information 1.0.1 "Network Information"
cordova-plugin-splashscreen 2.1.0 "Splashscreen"
cordova-plugin-whitelist 1.0.0 "Whitelist"
de.appplant.cordova.plugin.email-composer 0.8.3dev "EmailComposer"
de.neofonie.cordova.plugin.nativeaudio 3.1.0 "Cordova Native Audio"
nl.x-services.plugins.googleplus 1.1.2 "Google+"
nl.x-services.plugins.socialsharing 4.3.19 "SocialSharing"
nl.x-services.plugins.toast 2.1.1 "Toast"
onesignal-cordova-plugin 1.9.0 "OneSignal Push Notifications"

,这里是我的build.gradle依赖项

//生成的文件!不要编辑!

...

dependencies{
compile fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START
debugCompile project(path: ":CordovaLib", configuration: "debug")
releaseCompile project(path: ":CordovaLib", configuration: "release")
debugCompile project(path: ":com.phonegap.plugins.facebookconnect:oauth634839-FacebookLib", configuration: "debug")
releaseCompile project(path: ":com.phonegap.plugins.facebookconnect:oauth634839-FacebookLib", configuration: "release")
debugCompile project(path: ":com.google.playservices:oauth634839-google-play-services_lib", configuration: "debug")
releaseCompile project(path: ":com.google.playservices:oauth634839-google-play-services_lib", configuration: "release")
compile "com.google.android.gms:play-services-gcm:7.3.0" 
compile "com.google.android.gms:play-services-analytics:7.3.0" 
// SUB-PROJECT DEPENDENCIES END
}

...

我知道错误来自这里,但我不知道如何让单个软件包com.google.android.gms,当我知道我还没有直接编辑build.gradle文件时

感谢。

1 个答案:

答案 0 :(得分:1)

如果有人遇到同样的问题,那就是解决方案,https://documentation.onesignal.com/docs/troubleshooting-cordova-variants#section-clean-build 问题来自模块"一个信号"