简体   繁体   中英

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. After that, when the IDE opens it tries to install 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:

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+ ?

I think you have an incorrect version on your compile tag (23.0.1, instead of 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):

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)

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

I increased tmpfs size and the problem was gone.

I also had this problem with AndroidStudio 2.1.1 running on Fedora laptop. 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. When I checked my file systems with df , only tmpfs looked full. 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. We've got to check also somewhere else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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