gpt4 book ai didi

android - 如何在 gradle 中添加 appcompat?

转载 作者:行者123 更新时间:2023-12-04 23:40:07 26 4
gpt4 key购买 nike

Could not find com.android.support:appcompat-v7:24.2.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/support/appcompat-v7/24.2.1/appcompat-v7-24.2.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :app
这里 build.gradle :
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
buildToolsVersion "24.0.3"
useLibrary 'org.apache.http.legacy'

defaultConfig {
applicationId "com.rts.dcmote.dcmote"
minSdkVersion 15
targetSdkVersion 30
versionCode 2
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {

//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:24.2.1'

}

最佳答案

更新(2020 年 6 月):
对于 Android Studio >=4.2.0,项目根目录下的 build.gradle 会是这样的:

buildscript {
repositories {
google()
mavenCentral()
}
...

关于android - 如何在 gradle 中添加 appcompat?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62496557/

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