无法解决:com.android.support

当我第一次构建一个新的Android Studio项目时,我得到了Failed to resolve: com.android.support 。 我知道在这里有几个类似的问题,但这些解决方案似乎没有为我工作。

不知道这是否相关,但请注意,错误只是Failed to resolve: com.android.support而不是Failed to resolve: com.android.support:appcompat-v7:...或其他一些Android支持库包。

这是我认为是相关的代码位。

 apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 26 buildToolsVersion "26.0.2" defaultConfig { applicationId "checkin.yetanotherdev.com.checkin" 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 { compile fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" compile "com.android.support:appcompat-v7:26.1.0" implementation 'com.android.support.constraint:constraint-list_item:1.0.2' implementation 'com.android.support:design:26.1.0' implementation 'com.android.support:support-v4:26.1.0' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.android.support:recyclerview-v7:26.1.0' compile 'com.squareup.picasso:picasso:2.5.2' compile 'com.squareup.okhttp3:logging-interceptor:3.8.0' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.android.support:design:26.1.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' } 

顶级构建文件(Android Studio版本> 3)

 buildscript { ext.kotlin_version = '1.1.61' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

SDK工具截图 SDK工具截图 让我知道如果我提供更多的信息。