0

我已经将工件部署到 bintray,因为它在文档中变小了(使用他们的插件)。一切看起来都很好。它在浏览器中打开,结构看起来很好:https ://dl.bintray.com/flymob/maven/

现在我想在发布到 jcenter() 之前通过 Android Studio 中的 gradle 使用它。我已经阅读了他们的文档https://bintray.com/docs/usermanual/formats/formats_mavenrepositories.html#_working_with_gradle

我试过了:

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://dl.bintray.com/flymob/maven"
        }
    }
}

compile 'flymob-sdk-sample:FlyMobSdk:1.3.0'

或者

compile 'flymob-sdk-sample:FlyMobSdk:1.3.0@aar'

我收到错误:无法解决:flymob-sdk-sample:FlyMobSdk:1.3.0

我究竟做错了什么?

4

1 回答 1

3

"https://dl.bintray.com/flymob/maven"在该buildscript部分内添加。这些只是 buildscript(又名 gradle 脚本)使用的存储库。这些是系统将从中找到插件的存储库apply plugin

修复它很容易。只需将其移动到repositories脚本的“根”上。就像是:

buildscript {
    repositories {
        // repos for the build script
        jcenter()
        ... etc
    }

    dependencies {
        // dependencies from the plugins from the build script
        classpath 'com.android.tools.build:gradle:2.1.2'
        ... etc
    }
}

apply plugin: 'android-sdk-manager'
apply plugin: ... etc

repositories {
    jcenter()
    maven { url "https://dl.bintray.com/flymob/maven" } <<<<< HERE 
}

dependencies {
    compile ... etc
于 2016-06-08T10:12:02.507 回答