在build.gradle中添加多个存储库:android

时间:2017-09-11 14:06:56

标签: android gradle

我正在尝试将所有存储库管理到一棵树中并尝试以下

apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'

buildscript {
repositories {
    maven {
        url 'https://maven.fabric.io/public'
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
}
repositories {
    jcenter()
    maven { url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-android-sdk' }
    maven { url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/' }
    maven { url 'https://jitpack.io' }
    maven {
        url 'http://phonepe.bintray.com/PhonePeAndroidSDK-SNAPSHOT'
        credentials {
            username 'phonepe_android_sdk_snapshot_0_1_0@phonepe'
            password 'xxxxxxxxxxx'
        }
    }

}
dependencies {
   compile 'phonepe.sdk.android.snapshot:merchantSdk:0.5.9.1'
   compile 'in.juspay:ec-android-sdk:1.1.6'
   compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
    transitive = true;
   }
   compile project(':PayWithAmazon')
}

我试图构建代码,它总是说无法解决我在上面的代码中显示的所有依赖项。

如果我单独声明所有这些存储库并运行构建并且它成功构建项目没有任何问题。我明白我到底犯了什么错误。 请帮助理解这个问题。

如果我已经单独添加这些存储库,则下面工作正常

 buildscript {
 repositories {
    maven { url 'https://maven.fabric.io/public' }
 }

  dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
}
//apply plugin: 'com.android.application'
apply plugin: 'com.android.feature'
apply plugin: 'io.fabric'
// For Fabric
repositories {
  jcenter()
  maven { url 'https://maven.fabric.io/public' }
}
//For Localytics
repositories
    {
        jcenter()
        maven { url 'http://maven.localytics.com/public' }
    }

//For JusPay
repositories
    {

        maven {
            url 'https://s3-ap-southeast-1.amazonaws.com/jp-build-packages/ec-   android-sdk'
        }
        maven {
            url 'https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/'
        }

    }

//for Phone Pe staging
repositories {
   mavenCentral()
   maven {
      url "https://jitpack.io"
   }

maven {
    url "http://phonepe.bintray.com/PhonePeAndroidSDK-SNAPSHOT"

    credentials {
        username 'phonepe_android_sdk_snapshot_0_1_0@phonepe'
        password 'xxxxxxxxxxx'
    }
 }
}

谢谢 - 雅库布。

0 个答案:

没有答案