gpt4 book ai didi

android - 无法解析 : com. android.support :appcompat-v7:26. 0.0

转载 作者:IT老高 更新时间:2023-10-28 13:10:30 24 4
gpt4 key购买 nike

我在 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>

这是我的 Gradle 代码:

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'
}

最佳答案

要使用从版本 26.0.0 开始的支持库,您需要将 Google 的 Maven 存储库添加到项目的 build.gradle 文件中,如下所述:https://developer.android.com/topic/libraries/support-library/setup.html

allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

对于 Android Studio 3.0.0 及更高版本:

allprojects {
repositories {
jcenter()
google()
}
}

关于android - 无法解析 : com. android.support :appcompat-v7:26. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45357000/

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