无法解析":app@debug/compileClasspath"的依赖关系:无法将 URL 'com.google.android.gms:play-services-maps:17.0.0'转



我正在YouTube上的Android Codeing构建Google Maps演示。我构建了该应用程序,但由于某种原因,我不断收到错误消息

无法将网址"com.google.android.gms:play-services-maps:17.0.0"转换为文件。

这是我build.gradle(谷歌地图项目演示(:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

谁能帮忙? 编辑:复制并粘贴相同的代码两次,这是我的实际build.gradle(模块:应用程序(**

这是我的app/build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.zydavia.googlemapsdemo"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation files('com.google.android.gms:play-services-maps:17.0.0')
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-runtime:2.1.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.1.0'
}

删除此行:

//implementation files('com.google.android.gms:play-services-maps:17.0.0')

相关内容

最新更新