Islam Salah
Islam Salah

Reputation: 983

Could not find design.jar (com.android.support:design:27.0.0)

Every time I try to build an apk it fails with this error:

> Could not find multidex.jar (com.android.support:multidex:1.0.2).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/multidex/1.0.2/multidex-1.0.2.jar
> Could not find design.jar (com.android.support:design:27.0.0).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/design/27.0.0/design-27.0.0.jar
> Could not find common.jar (android.arch.core:common:1.0.0).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/core/common/1.0.0/common-1.0.0.jar

I checked the JCenter status it's working properly.

So Why it fails?

UPD

The same code used to build a couple of days ago!

here is the project level build.gradle

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven {
            // All of React Native (JS, Android binaries) is installed from npm
            url "$rootDir/reactnative/node_modules/react-native/android"
        }
        jcenter()
        maven { url "https://jitpack.io" }
        maven {url "https://clojars.org/repo/"}
        maven { url "https://maven.google.com" }
        mavenCentral()
    }
}

Upvotes: 3

Views: 671

Answers (1)

Sagar
Sagar

Reputation: 24947

com.android.support:design:27.0.0 is not available in jcenter() repository but in google() repository. Looking at your error logs, looks like Android studio is trying to find it in jcenter(). To enforce it to look inside google() make google() as your first statement or place it above jcenter() in both repositories{..} blocks.

repositories {
    ...
    google()
    jcenter()
    ...
}

Upvotes: 4

Related Questions