gpt4 book ai didi

android - 错误:尝试添加多个依赖项时无法解决:com.android

转载 作者:行者123 更新时间:2023-12-03 05:35:11 25 4
gpt4 key购买 nike

我现在正在学习1.5岁的Udemy指南,我刚刚购买了各种高级android东西。我到了要加载一堆第三方库的地步,所以我按照指南进行操作,并得到以下错误提示:


ERROR: Failed to resolve: com.android
Affected Modules: app


WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Remove Build Tools version and sync project
Affected Modules: app



这是我的项目级别gradle-

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

ext {
compileSdkVersion = 28
buildToolsVersion = '26.0.2'
minSdkVersion = 23
targetSdkVersion = 28
supportLibraryVersion = '26.1.0'
daggerVersion = '2.11'
retrofitVersion = '2.3.0'
moshiVersion = '1.5.0'
autoValueVersion = '1.5.1'
autoValueMoshiVersion = '0.4.3'
rxJavaVersion = '2.1.4'
rxAndroidVersion = '2.0.1'
rxRelayVersion = '2.0.0'
conductorVersion = '2.1.4'
}

task clean(type: Delete) {
delete rootProject.buildDir
}



这是我的应用程序级别的gradle-

apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.example.androidadvanced1"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design'$supportLibraryVersion"

implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-android-processor:$daggerVersion"
annotationProcessor "com.google.dagger:dagger-compiler:$daggerVersion"

implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"
implementation "com.squareup.moshi:moshi:$moshiVersion"
annotationProcessor "com.ryanharter.auto.value:auto-value-moshi:$autoValueMoshiVersion"
compileOnly "com.ryanharter.auto.value:auto-value-moshi-annotations:$autoValueMoshiVersion"

compileOnly "com.google.auto.value:auto-value:$autoValueVersion"
annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"

implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidVersion"
implementation "com.jakewharton.rxrelay2:rxrelay:$rxRelayVersion"

implementation "com.bluelinelabs:conductor:$conductorVersion"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}



我究竟做错了什么 ?

最佳答案

更新您的Gradle friend ,您的Android Studio版本,gradle和依赖项应匹配。

关于android - 错误:尝试添加多个依赖项时无法解决:com.android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56723329/

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