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

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

问题描述

我找到了2个解决此问题的方法,但两种方法均无效.所以我决定问你.

我正在使用Debian 8 Jessie和Android Studio 1.4

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

1)安装存储库并同步项目

当我尝试它时,出现了这样的错误:

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依赖项:

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)在项目结构"对话框中显示

依赖性窗口打开,并再次关于此行:

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

尝试过的解决方案:

首先,我尝试再次下载sdk版本.我删除了Android 4.0.3,然后再次重新下载,但仍然是相同的错误.

之后,我尝试下载推荐的支持库; 主题1

因此,我尝试了所有发现的问题,但仍然收到此错误.有人可以帮我吗?

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

如果您下载了23.0.1,请按以下步骤进行设置:

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

编辑: 另外请注意,在版本号中使用+时,Android Studio会给出以下提示:

避免在版本号中使用+;可能导致无法预测且无法复制的版本(com.android.support:appcompat-v7:23.1.+)

在依赖项中使用+可让您自动选择最新的 可用版本,而不是特定的命名版本.但是这个 不推荐;您的构建不可重复;你可能有 经过测试,版本与构建服务器略有不同 用过的. (使用动态版本,因为主要版本号更多 而不是在次要版本中使用它.)

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

I'm using Debian 8 Jessie and Android Studio 1.4

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) 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.

And down of the window:

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) Show in File

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

Error in this line:

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

3) Show in Project Structure dialog

Dependencies windows is opened and about this line again:

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

Tried Solutions:

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

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.

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?

解决方案

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

If you downloaded 23.0.1 set it like this:

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

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

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天全站免登陆