Error:Attribute “theme” has already been defined

原创
2015/07/21 12:30
阅读数 1K

使用Google Map真的不易啊

这个错误在StackOverflow上有很多人问。个人使用的库是:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:5.0.77'
    compile 'com.android.support:appcompat-v7:22.0.0'
}

StackOverflow解决的办法还是不少,最主要的办法是重新使用一个可以兼容的库。经过尝试,下面的两个库可以在一起通过编译。

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:5.0.77'
    compile 'com.android.support:appcompat-v7:20.0.0'
}

这个方案,会要求将targetSdkVersion降到20。

还有一个思路,是升级到最新的库,但是个人没有从网上找到。

Google Map还有个弊端是要求安装app的机器必须有匹配版本的Play Service。很多厂商并没有预装Play Service。如果没有,又需要自己去装。作为一个系统服务,现在碰到的问题老是闪退。

总结,如果不是非常需要Google Map,建议使用其他地图,比如高德,百度。它们的使用要方便很多。没有那么多的依赖。

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部