2015-12-18 31 views
0

我正在为我的项目使用asne google plus library。它使用较旧版本的Google Play服务。Android,一个旧谷歌播放服务与谷歌地图冲突的图书馆

当我加入谷歌的地图,新版本,gradle这个构建失败,此消息:

Error:Execution failed for task ':app:processDebugResources'. 
Error: more than one library with package name 'com.google.android.gms' 

我依赖我app.gradle:

compile 'com.github.asne:asne-googleplus:0.3.3' 

compile 'com.google.android.gms:play-services-maps:8.3.0' 
compile 'com.google.android.gms:play-services-location:8.3.0' 

当我做asne这样的:

compile ('com.github.asne:asne-googleplus:0.3.3') { 
    transitive = true 
} 

这个库变得不可见,我不能调用它的方法。

如何解决此冲突?

+0

您不能在一个项目中使用具有不同版本的两个库。尝试更新包含旧库的播放服务库。 – goblin

+0

这怎么可能? –

回答

0

我建议您使用整个依赖

compile 'com.google.android.gms:play-services:8.3.0' 

,而不是把它分割成像播放服务 - 零件位置:8.3.0和播放服务地图:8.3.0。这link提供了一个详细的解释为什么。

0

你可以尝试只排除库的谷歌的依赖关系:

compile ('com.github.asne:asne-googleplus:0.3.3') { 
    exclude group: 'com.google.android.gms' 
} 
+0

确定gradle是编译好的,但是当我尝试调用'asne'方法时,会引发一个异常:'java.lang.NoClassDefFoundError:com.github.gorbin.asne.googleplus.GooglePlusSocialNetwork' –

相关问题