本文介绍了无法解析':app @ debugAndroidTest/compileClasspath'的依赖项:无法解析com.google.android.gms:play-services-maps:11.8.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下错误:

在android studio中创建新的地图项目时出现此错误.

This error arises while creating a new map project in android studio.

我的 build.gradle :

apply plugin: 'com.android.application'android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.phaniteja.maps"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

有人可以帮助我吗?

推荐答案

allprojects {
repositories {
    jcenter()
    maven { url "https://maven.google.com" }
}}

在build.gradle中添加它.如果您使用的是google_service.json,请确保此 apply插件:'com.google.gms.google-services'位于依赖项之后,以避免版本问题.还要添加classpath. classpath'com.google.gms:google-services:3.2.0'

Add this in build.gradle. If you are using google_service.json ensure this apply plugin: 'com.google.gms.google-services' comes after your dependencies to avoid version issues.Add classpath too .classpath 'com.google.gms:google-services:3.2.0'

这篇关于无法解析':app @ debugAndroidTest/compileClasspath'的依赖项:无法解析com.google.android.gms:play-services-maps:11.8.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:14