如何使用现有依赖项(Google AdMob)的继承创建依赖项/库并通过我的依赖项使用它?

时间:2017-11-16 10:38:20

标签: android maven compilation android-gradle

我正在创建此库并在其中使用Google AdMob。上传到JFrog Bintray后,我收到了一个gradle链接。我尝试使用它来编译,但我收到错误错误:无法解决:com.google.android.gms:play-services-ads:11.6.0

apply plugin: 'com.android.library'     申请插件:' com.jfrog.bintray'     apply plugin:' com.github.dcendents.android-maven'

group = 'Package-Name'
version = 'Version-number'

bintray {
    user = "user-name"
    key = "API-Key"

    pkg {
        repo = 'maven'
        name = 'name'

        licenses = [required-license]
    }
    configurations = ['archives']
}

android {
    compileSdkVersion 26
    buildToolsVersion "27.0.0"

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 26
    }

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
    task generateSourcesJar(type: Jar) {
        from android.sourceSets.main.java.srcDirs
        classifier 'sources'
    }

    task generateJavadocs(type: Javadoc) {
        source = android.sourceSets.main.java.srcDirs
        classpath += project.files(android.getBootClasspath()
                .join(File.pathSeparator))
    }

    task generateJavadocsJar(type: Jar) {
        from generateJavadocs.destinationDir
        classifier 'javadoc'
    }
    artifacts {
        archives generateJavadocsJar
        archives generateSourcesJar
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-

core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-`annotations'`
    })
    compile 'com.android.support:appcompat-v7:26.+'

    compile 'com.google.android.gms:play-services-ads:11.6.0'
    testCompile 'junit:junit:4.12'
}

我该如何解决这个问题? 请帮忙。 提前谢谢。

0 个答案:

没有答案