将Google Play服务添加到图书馆项目中 [英] Adding Google-Play-Services to library project

查看:462
本文介绍了将Google Play服务添加到图书馆项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用地图库,而我正在使用Google Play服务。到现在为止还挺好。问题是这样的:


  1. 我在我的地图库中包含Google Play服务库项目(使用:properties - > android - >添加库)。使用库中的客户端进行测试(Unchcecking库复选框并启动mainActivity)并且工作正常!

  2. 当我将地图库包含在示例客户端项目中时,此客户端项目将无法访问Google Play服务,为什么?如果我在客户端项目中包含Google Play服务,我得到:



    [2013-07-18 08:40:04 - Dex Loader]无法执行dex:Multiple dex文件定义Lcom / google / android / gms / R $ attr;



    [2013-07-18 08:40:04 - maps-sample-android]转换为Dalvik格式失败:无法执行dex:多个dex文件定义Lcom / google / android / gms / R $ attr;


Android不能自行包含Google Play服务或使用我的图书馆项目,有没有办法解决这个问题?

解决方案

[2013-07-18 08:40:04 - Dex Loader]无法执行dex:多个dex文件定义Lcom / google / android / gms / R $ attr;



[2013-07-18 08:40:04 - maps-sample-android]转换为Dalvik格式失败:无法执行dex:多个dex文件定义Lcom / google / android / gms / R $ attr ;



这些错误表明您有两个不同的jar文件,它们都试图声明相同变量。也许你有两个不同版本的谷歌播放服务?


I'm working on a map library and I'm using Google-Play-Services. So Far so good. Problem is this:

  1. I include Google-Play-Services library project in my map library (using: properties -> android -> add library). Tested it using a client within the library (Unchcecking the library checkbox and launching a mainActivity) and works fine!
  2. When I include my map library in a sample client project, this client project won't have access to Google Play Services, why? If I include Google play services in the client project, I get:

    [2013-07-18 08:40:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

    [2013-07-18 08:40:04 - maps-sample-android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

Android won´t let include Google Play Services on my own or use it from my library project, is there any way to solve this?

解决方案

[2013-07-18 08:40:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

[2013-07-18 08:40:04 - maps-sample-android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

These errors suggest that you have 2 different jar files which are both trying to declare the same variable. Perhaps you have 2 different versions of the google-play-services?

这篇关于将Google Play服务添加到图书馆项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆