gpt4 book ai didi

android - Gradle项目同步失败(相关性错误)

转载 作者:行者123 更新时间:2023-12-03 05:46:53 26 4
gpt4 key购买 nike

添加新的依赖项时,错误显示为:

C:\Users\Davud\Desktop\android projects\SaySistemleri\app\build.gradle Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.google.android.gms:play-services-ads:12.0.1. Open File
Show Details Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.google.android.gms:play-services-ads:12.0.1. Open File
Show Details Error:Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-ads:12.0.1. Open File
Show Details Error:Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve com.google.android.gms:play-services-ads:12.0.1. Open File
Show Details Error:Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve com.google.android.gms:play-services-ads:12.0.1. Open File
Show Details



Gradle 代码:
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.davud.numberrepresentator"
minSdkVersion 14
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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'
compile 'com.android.support:design:26.1.0'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
}

最佳答案

在顶层build.gradle中添加以下行的网址maven.google.com
allprojects { repositories { jcenter() maven { url 'https://maven.google.com' } } }

关于android - Gradle项目同步失败(相关性错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49595383/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com