Phil
Phil

Reputation: 7597

Could not find android.support.design, ...play-services, ...support, ...appcompat

I know there are plenty of similar questions, but I did try the solutions described there with no success. I have reinstalled and updated Android Studio, I have cleaned the project, I have synchronized and invalidated caches and restarted it. I still get this error when building the project (which runs on other PCs):

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
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.4.0.
 Searched in the following locations:
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.pom
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.jar
     https://jcenter.bintray.com/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.pom
     https://jcenter.bintray.com/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.jar
 Required by:
     MyApp:app:unspecified
   > Could not find com.android.support:design:23.4.0.
 Searched in the following locations:
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/design/23.4.0/design-23.4.0.pom
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/design/23.4.0/design-23.4.0.jar
     https://jcenter.bintray.com/com/android/support/design/23.4.0/design-23.4.0.pom
     https://jcenter.bintray.com/com/android/support/design/23.4.0/design-23.4.0.jar
 Required by:
     MyApp:app:unspecified
  > Could not find com.google.android.gms:play-services:9.0.1.
 Searched in the following locations:
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/android/gms/play-services/9.0.1/play-services-9.0.1.pom
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/google/android/gms/play-services/9.0.1/play-services-9.0.1.jar
     https://jcenter.bintray.com/com/google/android/gms/play-services/9.0.1/play-services-9.0.1.pom
     https://jcenter.bintray.com/com/google/android/gms/play-services/9.0.1/play-services-9.0.1.jar
 Required by:
     MyApp:app:unspecified
    > Could not find com.android.support:support-v4:23.4.0.
 Searched in the following locations:
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
     file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
     https://jcenter.bintray.com/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
     https://jcenter.bintray.com/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
 Required by:
     MyApp:app:unspecified

My Gradle app file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "myapp"
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.google.code.gson:gson:2.4'
    compile 'com.google.android.gms:play-services:9.0.1'
    compile 'com.android.support:support-v4:23.4.0'
}

This is extremely frustrating, please tell me what to do.

Upvotes: 1

Views: 592

Answers (2)

atroutt
atroutt

Reputation: 471

Try running this to install the required libraries locally:

android update sdk --no-ui --all --filter tool,extra-android-m2repository,extra-android-support,extra-google-google_play_services,extra-google-m2repository,android-23

Upvotes: 1

Lars de Pauw
Lars de Pauw

Reputation: 1

Since you already tried all the other options, I would suggest deleting the project directory and do another pull from your repository. That or your files are in program files (x86) but that's just silly.

Upvotes: 0

Related Questions