簡體   English   中英

Gradle和Android:無法解析依賴項com.android.support

[英]Gradle and Android: Could not resolve dependencies com.android.support

我正在嘗試將庫添加到我的Android項目中。 我收到一個錯誤:

無法解決:com.github.Kunzisoft:AndroidClearChroma:1.6

所以我增加了maven { url "https://jitpack.io" }repositoriesallprojects 現在上一個錯誤消失了,但我有一個新的意外錯誤:

Error:FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not find com.android.support:appcompat-v7:25.1.1.
     Required by:
         project :app
         project :app > com.android.support:design:25.1.0
   > Could not find com.android.support:support-annotations:25.1.1.
     Required by:
         project :app > com.android.support:recyclerview-v7:25.1.0
         project :app > com.android.support:design:25.1.0 > com.android.support:transition:25.1.0
         project :app > com.android.support:recyclerview-v7:25.1.0 > com.android.support:support-compat:25.1.0
         project :app > com.android.support:recyclerview-v7:25.1.0 > com.android.support:support-core-ui:25.1.0
         project :app > com.android.support:design:25.1.0 > com.android.support:support-v4:25.1.0 > com.android.support:support-media-compat:25.1.0
         project :app > com.android.support:design:25.1.0 > com.android.support:support-v4:25.1.0 > com.android.support:support-core-utils:25.1.0
   > Could not find com.android.support:appcompat-v7:25.1.1.
     Required by:
         project :app > com.github.Kunzisoft:AndroidClearChroma:1.6
   > Could not find com.android.support:preference-v7:25.1.1.
     Required by:
         project :app > com.github.Kunzisoft:AndroidClearChroma:1.6
   > Could not find com.android.support:support-annotations:25.1.1.
     Required by:
         project :app > com.github.Kunzisoft:AndroidClearChroma:1.6

Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

好像Gradle找不到基本的Android庫。 我該如何解決?

這是我的頂級build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

google propriatory modules com.android.support*.*不能從公共maven存儲庫獲得。 你必須從android-sdk-manager本地安裝所需的版本(在你的情況下是25.1.0或25.1.1)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM