13

Today I updated a new SDK, then my project caused a problem blow. I've already downloaded Android Support Repository, but it still didn't work. Error:A problem occurred configuring project ':app'.

Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.android.support:appcompat-v7:24.2.0. Searched in the following locations: file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar https://jcenter.bintray.com/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar file:/C:/Users/Owner.KFW-39238/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom file:/C:/Users/Owner.KFW-39238/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar file:/C:/Users/Owner.KFW-39238/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.pom file:/C:/Users/Owner.KFW-39238/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/24.2.0/appcompat-v7-24.2.0.jar Required by: Invoice:app:unspecified

Qirui
  • 133
  • 1
  • 1
  • 5
  • 1
    I got same problem after update Android. I have upgrade to com.android.support:appcompat-v7:24.2.1 to solved this problem. – Brian Hoang Sep 14 '16 at 02:02
  • 1
    Possible duplicate of [Android Studio could not find any version that matches com.android.support:appcompat-v7:+](http://stackoverflow.com/questions/19621941/android-studio-could-not-find-any-version-that-matches-com-android-supportappco) – karan Sep 14 '16 at 04:59

4 Answers4

17

As the latest version of the support library according to the support library changelog is v7:24.2.1 and not v7:24.2.0 modify your build.gradle to have v7:24.2.1:

compile "com.android.support:appcompat-v7:24.2.1"
Wayne Ellery
  • 7,888
  • 1
  • 28
  • 45
  • Thank you so much, I found and changed what you said, it works! – Qirui Sep 14 '16 at 23:12
  • what is your source? it would be helpful to be able to look up the latest version at any point in time, not just when you wrote this answer. – swrobel Nov 13 '16 at 23:29
  • 1
    @swrobel Updated my answer. Source is: https://developer.android.com/topic/libraries/support-library/revisions.html – Wayne Ellery Nov 14 '16 at 00:20
2

I had similar issue tonight after I upgraded Android SDK Tools. I went to the app/build.gradle file. Down to the dependencies section. Two of my dependencies were highlighted stating I should upgrade to a newer version. I updated to version suggested and the error went away. For my situation I used 24.2.1 of the libraries that caused the error.

Eric Gould
  • 21
  • 1
1

I had similar problem. after change compileSdkVersion to 24 , update android support repository and change appcompat version, the problem solved.

compile "com.android.support:appcompat-v7:24.2.1"
Manian Rezaee
  • 1,012
  • 12
  • 26
0

After upgrading sdk to your needs and if yet that error is showing, maybe you didn't set the version correctly. You can do it like this: Create a new project. go to gradle file,

compile 'com.android.support:appcompat-v7:24.0.0-alpha2'

Maybe you need to change these also so compare them too.

minSdkVersion 
targetSdkVersion
Kurt Van den Branden
  • 11,995
  • 10
  • 76
  • 85