Android Studio:appcompat安装失败

时间:2015-10-10 14:11:02

标签: android android-studio android-appcompat

我有一个奇怪的问题。我刚刚安装了最新版本的android studio并创建了一个简单的vanilla空白活动应用程序。之后,当IDE打开时,它会尝试安装com.android.support:appcompat-v7:14+。但是,然后我收到错误消息:

Failed to resolve: com.android.support:appcompat-v7:14+
Install repository and sync project

所以,我点击了Install repository and sync project,然后我收到以下错误消息:

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 you project, but it will not compile correctly without the missing components.

所以,我的互联网连接非常好,没有流量被防火墙或其他东西堵塞。

这里有什么问题?是否有安装com.android.support:appcompat-v7:14+的替代方法?

3 个答案:

答案 0 :(得分:1)

我认为你的编译标签版本不正确(23.0.1,而不是14 +):

尝试:

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

而不是:

com.android.support:appcompat-v7:14+

您可能还需要更新您的编译和工具版本(这是使用新版本的AppCompat等所必需的):

compileSdkVersion 23
buildToolsVersion "23.0.1"

答案 1 :(得分:0)

进入SDK管理器,确保您已更新支持库(您将看到我已在图像中检查了这些)

您需要确保这些内容已更新。enter image description here

仅供参考,这是Android Studio中的新SDK下载 - 您的UI可能会略有不同,但您仍需要更新这些组件

答案 2 :(得分:0)

我增加了tmpfs的大小,问题就消失了。

我在Fedora笔记本电脑上运行AndroidStudio 2.1.1也遇到了这个问题。乍一看这个解决方案听起来很荒谬,因为错误消息说我们应该检查网络连接。有一段时间我没有找到解决办法。在某些时候,Gradle也开始抱怨他在磁盘上没有足够的空间。当我使用df检查文件系统时,只有tmpfs看起来已满。因此我扩展了它。然后组件安装问题也解决了。

您可能无法通过增加tmpfs来解决您的问题,但重点是不要被错误消息误导。我们还要在其他地方检查。