Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.android.support:appcompat-v7:15.+

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?

like image 300
codebender Avatar asked Oct 13 '15 15:10

codebender


6 Answers

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

like image 146
AlbAtNf Avatar answered Nov 15 '22 14:11

AlbAtNf


Try following solution:

In Android studio: Go to File -> Project structure Check the selected Build Tools Version.

update your build.gradle for app with selected build tools version. for e.g. 19.1.0

After update, Run Clean.

Please refer below screenshot.[Project Structure-> Build Tools Types][1]

like image 41
ThatsAllFoks Avatar answered Oct 24 '22 15:10

ThatsAllFoks


Got same errors.

Mac OSX

V. 10.9.5

Android studio 1.4.1

App:

Before: android { compileSdkVersion 15 buildToolsVersion "19.1.0"

After: android { compileSdkVersion 23 buildToolsVersion "19.1.0"

Before: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:15.+' }

After: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.o' }

Above changes + Build >> Clean Project.

Hope that helps!

like image 32
BusinessFawn Avatar answered Nov 15 '22 12:11

BusinessFawn


Edit build.gradle

Replace 'com.android.support:appcompat-v7:15.+' with 'com.android.support:appcompat-v7:18.0.0'

Sync It

May be this will help you. If in case this will not work i.e. show error then see for installation of app-compat in "%homepath%\AppData\Local\Android\sdk\extras\android\m2repository\com\android\support\appcompat-v7"

Search for the oldest version and put the version number at xx: 'com.android.support:appcompat-v7:xx'

like image 3
masoomyf Avatar answered Nov 15 '22 12:11

masoomyf


I installed Java and Android Studio today.

When creating my first project with API level 15 as minSDK, I faced the same problem.

As far as I can tell, it seems the installation of the sdk works not pretty well. For me, API level 15 had only the SDK platform. API level 23 had platform and sources. I don't remember, which tools where installed.

To solve the problem, I started the sdk manager (old version), removed api level 15 completely and installed api level 23 as suggested. After that, a newly created project (again with minSDK 15) was properly created.

The difference in the app/build.gradle file is obvious.

Maybe this helps other people facing the same issues, or one of the gurus can further explain, what happened.

Kind Regards

like image 2
Daniel Avatar answered Nov 15 '22 12:11

Daniel


Go to Built tab select "Edit Built types" select properties tab and check built tool version it was 19.1.1 for me.
Then go to built.gradle change compile to 'com.android.support:appcompat-v7:19+' . I changed to 19+ because my built version is 19.1.1 ; You have to select according to your built version(18+,19+,20+ like that).

like image 1
vaibhav Avatar answered Nov 15 '22 14:11

vaibhav