首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到design.jar (com.android.support:design:27.0.0)

找不到design.jar (com.android.support:design:27.0.0)
EN

Stack Overflow用户
提问于 2018-06-10 07:52:35
回答 1查看 662关注 0票数 3

每次我试图构建apk时,都会出现以下错误:

代码语言:javascript
复制
> 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

我检查了JCenter状态,它正常工作。

那为什么失败了?

UPD

几天前构建的代码是相同的!

以下是项目级别的build.gradle

代码语言:javascript
复制
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()
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-10 08:04:16

com.android.support:design:27.0.0不在jcenter()存储库中,而是在google()存储库中。看看您的错误日志,似乎Android正在试图在jcenter()中找到它。要强制它在google()内部查看,请将google()作为您的第一条语句,或者将其放在jcenter()之上的两个repositories{..}块中。

代码语言:javascript
复制
repositories {
    ...
    google()
    jcenter()
    ...
}
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50781629

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档