gpt4 book ai didi

android - 无法在 Android Studio 中安装支持存储库和同步项目

转载 作者:IT王子 更新时间:2023-10-29 00:07:25 25 4
gpt4 key购买 nike

我正在尝试使用 25.2.0 版本的支持库所以我可以使用 CameraKit图书馆。

我已经下载了最新的构建工具:

enter image description here

和支持存储库: enter image description here

我的 gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.sample.myapp"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
mavenCentral()
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'

// Google libraries
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.google.android.gms:play-services-vision:10.0.1'
compile 'com.android.volley:volley:1.0.0'

// Third party libraries
compile 'com.flurgle:camerakit:0.9.17'

compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
}

问题:对于每个支持库,我都会遇到问题:

Failed to resolve com.android.support:cardview-v7:25.2.0

如果我尝试点击安装存储库并同步项目,则什么也没有发生。

enter image description here

我已关注 gradle file举个例子。会不会是我的错?

最佳答案

之前,Android 支持库依赖项是从 Android SDK 管理器下载的。

现在所有新版本都可以从 Google 的 Maven 存储库中获得。 future 所有的android库都将通过maven.google.com

分发

因此,通过将以下代码添加到存储库将构建项目。

repositories {
maven {
url "https://maven.google.com"
}
}

关于android - 无法在 Android Studio 中安装支持存储库和同步项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43495549/

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