简体   繁体   English

Android Studio:appcompat安装失败

[英]Android Studio: appcompat installation fails

I've a strange problem. 我有一个奇怪的问题。 I just installed the most recent version of android studio and created a plain vanilla blank activity application. 我刚刚安装了最新版本的android studio,并创建了一个普通的香草空白活动应用程序。 After that, when the IDE opens it tries to install com.android.support:appcompat-v7:14+ . 之后,当IDE打开时,它将尝试安装com.android.support:appcompat-v7:14+ However, then I get the error message: 但是,然后我收到错误消息:

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

So, I click on Install repository and sync project however, then I get the following error message: 因此,我单击“ 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.

And underneth it red it is stated: 并用红色表示:

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.

So, my internet connection is perfectly fine, no traffic gets block by an firewall or something. 因此,我的互联网连接非常好,没有流量被防火墙之类的东西阻塞。

What is wrong here? 怎么了 Are there alternatives for installing com.android.support:appcompat-v7:14+ ? 有安装com.android.support:appcompat-v7:14+替代方法吗?

I think you have an incorrect version on your compile tag (23.0.1, instead of 14+): 我认为您的编译标签上的版本不正确(23.0.1,而不是14+):

Try: 尝试:

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

instead of: 代替:

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

and you may need to update your compile and tools versions as well (which is required to use the new versions of AppCompat, etc): 并且您可能还需要更新编译和工具版本(使用新版本的AppCompat等需要):

compileSdkVersion 23
buildToolsVersion "23.0.1"

Go into your SDK Manager, and make sure you have updated the Support Libs (you will see I have those checked in the image) 进入您的SDK Manager,并确保您已经更新了支持库(您将在图像中看到我已选中的内容)

You will need to make sure these are updated. 您将需要确保这些已更新。 在此处输入图片说明

FYI, this is the new SDK Download in Android Studio - your UI may look slightly different, but you still need to update those components 仅供参考,这是Android Studio中的新SDK下载-您的用户界面看上去可能略有不同,但是您仍然需要更新这些组件

I increased tmpfs size and the problem was gone. 我增加了tmpfs的大小,问题消失了。

I also had this problem with AndroidStudio 2.1.1 running on Fedora laptop. 我在Fedora笔记本电脑上运行AndroidStudio 2.1.1时也遇到了这个问题。 At the first glance this solutions sounds ridiculous since the error message says we should check the network connection. 乍一看,这种解决方案听起来很荒谬,因为错误消息说我们应该检查网络连接。 For some time I left off the problem because I did not find the solution. 一段时间以来,我一直没有解决问题,因为我没有找到解决方案。 At some point later Gradle also started to complain that he did not have enough space in the disk. 在某个时候, Gradle也开始抱怨磁盘上没有足够的空间。 When I checked my file systems with df , only tmpfs looked full. 当我使用df检查文件系统时,只有tmpfs看起来已满。 Thus I extended it. 因此,我扩展了它。 Then the component installation problem was also solved. 然后还解决了组件安装问题。

You might not solve your problem by increasing tmpfs, but the point is that DON'T be mislead by the error message. 您可能无法通过增加tmpfs来解决问题,但重点是不要误入错误消息。 We've got to check also somewhere else. 我们还必须检查其他地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM