【发布时间】:2015-10-13 15:13:53
【问题描述】:
我为这个问题找到了 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) 在项目结构对话框中显示
Dependencies 窗口被打开,又是关于这一行:
compile 'com.android.support:appcompat-v7:15.+'
尝试过的解决方案:
首先,我尝试再次下载版本 sdk。我删除了 Android 4.0.3 并再次重新下载,但仍然是同样的错误。
之后我尝试下载推荐的支持库; topic 1,topic 2。下载 Android 支持库后,rev 23.0.1 仍然出现同样的错误。
之后,我尝试通过错误地修复第一个选项来解决我的问题(安装存储库和同步项目。我又找到了一些主题。我在设置中检查了我的 HTTP 代理部分,已经选择了“无代理”。
所以,我尝试了所有找到的方法,但仍然出现此错误。有人可以帮帮我吗?
【问题讨论】:
-
如果你下载的是23.0.1,你有没有试过在gradle中设置这个版本?
compile 'com.android.support:appcompat-v7:23.0.1' -
哇,真的成功了!
-
如果我的回答对您有帮助,欢迎采纳。 ;)