user3160302
user3160302

Reputation: 237

Could not find com.android.support:design-23.2.1 and Could not find com.android.support.appcompat-v7-23.2.1 error

I can not compile an android project that is written in another computer.

The errors I get:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.android.support:appcompat-v7-23.2.1:.
     Searched in the following locations:
         file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.pom
         file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.jar
         https://jcenter.bintray.com/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.jar
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.pom
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.jar
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.pom
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7-23.2.1//appcompat-v7-23.2.1-.jar
     Required by:
         CalorieCalculator:app:unspecified
   > Could not find com.android.support:design-23.2.1:.
     Searched in the following locations:
         file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/design-23.2.1//design-23.2.1-.pom
         file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/design-23.2.1//design-23.2.1-.jar
         https://jcenter.bintray.com/com/android/support/design-23.2.1//design-23.2.1-.pom
         https://jcenter.bintray.com/com/android/support/design-23.2.1//design-23.2.1-.jar
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/design-23.2.1//design-23.2.1-.pom
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/design-23.2.1//design-23.2.1-.jar
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/design-23.2.1//design-23.2.1-.pom
         file:/C:/Users/umr/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/design-23.2.1//design-23.2.1-.jar

Here is the build.gradle dependencies

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

sdkSettings

Upvotes: 1

Views: 4995

Answers (4)

Jianxin Gao
Jianxin Gao

Reputation: 2777

To solve it from the command line:

echo y | android update sdk --no-ui --filter extra-android-m2repository --force --all

which basically installs "Android Support Repository" for the SDK Manager as CommonsWare mentioned in the original question's comments.

android is a command that lives in /Users/[username]/Library/Android/sdk/tools/ for macOS or [android sdk path]/android-sdk-linux/tools for linux.

Upvotes: 0

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363895

There are some typos in your dependencies.

Change

  compile 'com.android.support:appcompat-v7-23.2.1'
  compile 'com.android.support:design-23.2.1'

with

  compile 'com.android.support:appcompat-v7:23.2.1'
  compile 'com.android.support:design:23.2.1'

Upvotes: 2

Sagar Chavada
Sagar Chavada

Reputation: 5269

if you are importing other computer project on your android studio, make sure that project is compatible with your sdk, you are missing sdk support repository to compatible with that project,

so you have 2 way to run this project.

1. update sdk or,
2. create new project and copy paste module of that project with your sdk configuration

Upvotes: 0

VatsalSura
VatsalSura

Reputation: 926

Go to SDK Manager and go to SDK Tools tab. Check Android Support Library version and edit it in your build.gradle file. And if an error of "junit" comes, just remove that junit line from dependencies.

Upvotes: 1

Related Questions