Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find com.android.support:appcompat-v7:24.2.0

Tags:

android

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

like image 454
Qirui Avatar asked Sep 14 '16 01:09

Qirui


3 Answers

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"
like image 175
Wayne Ellery Avatar answered Sep 18 '22 14:09

Wayne Ellery


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.

like image 26
Eric Gould Avatar answered Sep 21 '22 14:09

Eric Gould


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"
like image 24
Manian Rezaee Avatar answered Sep 19 '22 14:09

Manian Rezaee