11
votes

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

4
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

4 Answers

17
votes

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"
2
votes

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.

1
votes

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"
0
votes

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