簡體   English   中英

Gradle無法從遠程Maven存儲庫下載

[英]Gradle cannot download from remote maven repository

在像這里這樣的幾個github庫上: https : //github.com/commonsguy/cwac-endless我發現了對存儲在亞馬遜上的存儲庫的引用。

repositories {
    maven {
        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
}

dependencies {
    compile 'com.commonsware.cwac:endless:1.2.3'
}

問題是,我不能讓它從這種存儲庫中下載依賴項。

這是我的build.gradle文件的示例:

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
        classpath 'com.github.dcendents:android-maven-plugin:1.0'
    }
}
apply plugin: 'android-library'
apply plugin: 'android-maven'

repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url "http://repo.commonsware.com/"
    }
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.2"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}


dependencies {
    compile 'com.googlecode.android-query:android-query:0.25.9'
    compile 'com.commonsware.cwac:endless:1.2.3'
    compile project(':FontLibrary')
}

我正在使用Intellij Idea 13,結果是:

Gradle 'OSKExplorer' project refresh failed:
         Could not find com.commonsware.cwac:endless:1.2.3.
         Required by:
         OSKExplorer:SwipeListViewComponent:unspecified > OSKExplorer:CommonLibrary:unspecified

不知道是否使用https://repo.commonsware.com.s3.amazonaws.com網址為您完成了此操作,但我會像這樣將maven {url}放在其中:

allprojects{
    repositories{
        mavenCentral()
        maven{ url "https://repo.commonsware.com.s3.amazonaws.com"}
    }
}

gl!

將https替換為http,例如http://repo.commonsware.com.s3.amazonaws.com

這對我有用。

更換

repositories {

    mavenCentral()
    maven {

        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
    maven {
        url "https://jitpack.io"
    }
}

repositories {

    mavenCentral()
    maven {

        url "http://repo.commonsware.com.s3.amazonaws.com"
    }
    maven {
        url "http://jitpack.io"
    }
}

網址不正確。 用這個對我有用

maven {url "http://s3.amazonaws.com/repo.commonsware.com" }

暫無
暫無

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

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