无法解析:com.android.support:appcompat-v7:15.+ [英] Failed to resolve: com.android.support:appcompat-v7:15.+

查看:38
本文介绍了无法解析:com.android.support:appcompat-v7:15.+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为这个问题找到了 2 个解决方案,但都没有奏效.所以我决定问你.

i find 2 solutions for this problem, but both didn't work. So i decided to ask you.

我使用的是 Debian 8 Jessie 和 Android Studio 1.4

I'm using Debian 8 Jessie and Android Studio 1.4

我刚刚创建了新项目,当我尝试启动它时出现错误:" 无法解析:com.android.support:appcompat-v7:15.+ "并给了我 3 个选项.

I just created new project and when i tried to start it i got an error: " Failed to resolve: com.android.support:appcompat-v7:15.+ " And gives me 3 option.

1) 安装 Repository 并同步项目

1) Install Repository and sync project

当我尝试它时,我得到了这样的错误:

When i tried it i got an error like this:

Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository'Warning: The package filter removed all packages. There is nothing to install.
         Please consider trying to update again without a package filter.

窗下:

Install failed. Please check your network connection and try again. You may continue with creating your project, but it will not complete correctly without the missing components.

2) 在文件中显示

这是我的 build.gradle 依赖项:

It's my build.gradle dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:15.+'
}

这一行的错误:

compile 'com.android.support:appcompat-v7:15.+'

3) 在项目结构对话框中显示

3) Show in Project Structure dialog

Dependencies 窗口被打开,关于这一行:

Dependencies windows is opened and about this line again:

compile 'com.android.support:appcompat-v7:15.+'

尝试过的解决方案:

首先,我尝试再次下载版本 sdk.我删除了 Android 4.0.3 并重新下载,但还是同样的错误.

Firstly, i tried to download version sdk again. I deleted Android 4.0.3 and re-download again but still same error.

之后我尝试下载推荐的支持库;主题 1 , 主题 2.下载 Android Support Library 后,rev 23.0.1 仍然出现同样的错误.

After that i tried to download support library which recommended in; topic 1 , topic 2. After i download Android Support Library, rev 23.0.1 still got same error.

在那之后,我尝试通过修复错误的第一个选项来解决我的问题(安装存储库和同步项目.我又找到了一些主题.我检查了设置中的 HTTP 代理部分,已经选择了无代理".

After that i tried to solve my problem with fixing first option in error (install repository and sync project. And i found some topics again. I checked my HTTP Proxy section in Setting, already "No proxy" is selected.

所以,我尝试了我找到的所有方法,但仍然出现此错误.有人可以帮我吗?

So, i tried everything i found, but still i got this error. Someone can help me please?

推荐答案

使用 sdk 管理器下载最新的支持库后,您可以在 gradle 文件中设置该版本.

After you downloaded the latest support library with your sdk manager, you can set that version in your gradle file.

如果您下载的是 23.0.1,请像这样设置:

If you downloaded 23.0.1 set it like this:

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

编辑:在版本号中使用 + 时,还要注意 Android Studio 给出的以下提示:

EDIT: Also note following hint, given by Android Studio, when using + in Version number:

避免在版本号中使用+;可能导致不可预测和不可重复的构建 (com.android.support:appcompat-v7:23.1.+)

Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds (com.android.support:appcompat-v7:23.1.+)

在依赖项中使用 + 可以自动获取最新的可用版本而不是特定的命名版本.然而,这不推荐;你的构建是不可重复的;你可能有使用与构建服务器略有不同的版本进行测试用过的.(使用动态版本作为主要版本号更多比在次要版本位置使用它有问题.)

Using + in dependencies lets you automatically pick up the latest available version rather than a specific, named version. However, this is not recommended; your builds are not repeatable; you may have tested with a slightly different version than what the build server used. (Using a dynamic version as the major version number is more problematic than using it in the minor version position.)

这篇关于无法解析:com.android.support:appcompat-v7:15.+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆