【问题标题】:GoogleMap is already defined in this compilation unitGoogleMap 已在此编译单元中定义
【发布时间】:2015-12-07 16:23:02
【问题描述】:
Error:(6, 1) error: GoogleMap is already defined in this compilation unit while building project from android studio.

如何解决这个问题

这是我使用的依赖项

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

【问题讨论】:

标签: android


【解决方案1】:

你应该在你的依赖中删除这一行:

compile 'com.android.support:appcompat-v7:23.0.1'

Google Play 服务的最新版本现在使用 appcompat-v7,因此您无法将它与 Google 地图一起使用。您只能使用 appcompat-v7 或之前版本的 Google 服务!

另请阅读Gradle error "Attribute "xxx" has already been defined" in Android Studio

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-28
    • 1970-01-01
    • 2015-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-26
    相关资源
    最近更新 更多