gpt4 book ai didi

android - 使用最新版本的 android 支持库编译项目依赖项

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:53:07 25 4
gpt4 key购买 nike

我在我的项目中使用 25 作为 targetSdkVersion,compileSdkVersion。然后出现警告。

Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

所以我将它提高到 26。然后我打开了我的 SDK Manager 并更新了所有内容:

SDK 工具、SDK 平台工具

然后出现另一个警告:

This support library should not use a lower version (25) than the targetSdkVersion (26)

我用的是这个版本:

    compile 'com.android.support:appcompat-v7:25.3.1'

现在我不知道我到底应该换到哪个版本。

我尝试了 7:26.0.0,我的 SDK Platform-Tools 现在是这个版本。

我尝试了 7:26.0.2,我的 SDK Tools 现在是这个版本。

同步后它们都给我错误:

Failed to resolve: com.android.support.appcompat-v7:26.0.2

Install repository and sync project

然后,如果我点击Install,什么也不会发生

现在我有一个简单的问题。我怎样才能找到最新版本的支持库?

最佳答案

将 maven 存储库添加到您的项目 gradle 文件中:

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

关于android - 使用最新版本的 android 支持库编译项目依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44505204/

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