我实际上只是第一次开始应用程序开发,而创建新项目时将无法构建默认项目。我尝试在Google和SO上查找这些错误,并发现了一些错误,但它们的解决方案不起作用。鉴于我根本没有编辑文件,因此我认为这是Android Studio设置不正确但无法解决的问题。错误如下:
Error:Failed to resolve: com.android.support:support-v4:25.2.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Error:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.2.2
Install Repository and sync project
Show in File
Show in Project Structure dialog
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.+
Install Repository and sync project
Show in File
Show in Project Structure dialog
它指向的build.gradle文件如下:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.extremecomputing.spotzz"
minSdkVersion 17
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'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.google.android.gms:play-services-maps:11.0.1'
testCompile 'junit:junit:4.12'
}
我尝试过以前的项目,该项目创建了一些我在网上找到的东西。就像他们+
在版本中建议的那样,可能会导致无法预测的构建,但事实并非如此。一个人在本dependencies
节中推荐了一些编译行,它暂时更改了错误,说我需要下载某些内容,然后我又做了一些操作,然后又回到了原始错误。我还试图确保SDK工具已更新,并且看起来确实如此。任何建议将不胜感激。
试试这个:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句