无法解析:com.android.support:appcompat-v7:26.0.0 [英] Failed to resolve: com.android.support:appcompat-v7:26.0.0
本文介绍了无法解析:com.android.support:appcompat-v7:26.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误:(22,13)无法解析:com.android .support:appcompat-v7:26.0.0
< a href =install.m2.repo>安装存储库和同步项目< / a>< br>< a href =openFile:C :/Users/username/AndroidStudioProjects/ElectroSave/app/build.gradle>在文件中显示< / a>< br>< a href =open.dependency.in.project.structure>在项目中显示结构对话框< / a>
这是我的Gradle代码:
apply plugin:'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion25.0.2
defaultConfig {
applicationIdcom.example.noelly.myapplication
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile'com.android.support:appcompat- v7:26.0.0'
}
解决方案
要使用从26.0.0版开始的支持库,您需要将Google的Maven资源库添加到项目的build.gradle文件中d here: https://developer.android.com/topic/libraries/ support-library / setup.html
allprojects {
知识库{
jcenter()
maven {
urlhttps://maven.google.com
}
}
}
对于Android Studio 3.0.0及以上版本:
allprojects {
repositories {
jcenter()
google()
}
}
I am having this issue in Android studio.
Error:(22, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile:C:/Users/username/AndroidStudioProjects/ElectroSave/app/build.gradle">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>
This is my Gradle code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.noelly.myapplication"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.0'
}
解决方案
To use support libraries starting from version 26.0.0 you need to add Google's Maven repository to your project's build.gradle file as described here: https://developer.android.com/topic/libraries/support-library/setup.html
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For Android Studio 3.0.0 and above:
allprojects {
repositories {
jcenter()
google()
}
}
这篇关于无法解析:com.android.support:appcompat-v7:26.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文