无法导入com.google.android.maps'

时间:2017-11-10 08:39:24

标签: java android google-maps gradle

我正在使用一个使用' MapActivity'的图书馆。软件包com.google.android.maps'但是这个包无法解决。我用的是Android工作室。这是我的build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
    applicationId "pl.llp.aircasting"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.google.android.gms:play-services-maps:7_r1'
compile 'org.roboguice:roboguice:1.1'
compile 'com.google.inject:guice:2.0-no_aop'
compile "com.google.guava:guava:16+"
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.intellij:annotations:+@jar'
testCompile 'junit:junit:4.12'
compile 'com.google.code.findbugs:jsr305:2.0.1'
compile 'ch.acra:acra:4.2.3'
}

2 个答案:

答案 0 :(得分:0)

此行存在于build.gradle文件中吗?

编译'com.google.android.gms:play-services-maps:9.8。+'

答案 1 :(得分:0)

更改您的地图相关性
compile 'com.google.android.gms:play-services-maps:7_r1'

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