【问题标题】:Resolving Artifacts from bintray via gradle (non jcenter)通过 gradle(非 jcenter)从 bintray 中解析工件
【发布时间】:2016-10-08 10:18:23
【问题描述】:

我已经将工件部署到 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

我做错了什么?

【问题讨论】:

    标签: android maven gradle aar bintray


    【解决方案1】:

    您在buildscript 部分中添加了"https://dl.bintray.com/flymob/maven"。这些只是 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
    

    【讨论】:

      猜你喜欢
      • 2019-03-01
      • 2017-05-06
      • 2017-11-06
      • 1970-01-01
      • 2020-12-04
      • 1970-01-01
      • 1970-01-01
      • 2015-10-07
      • 1970-01-01
      相关资源
      最近更新 更多