无法解析配置CompileClasspath的所有文件

时间:2019-09-21 14:31:40

标签: android gradle android-gradle-plugin

我正在尝试使用.. \ gradlew assembleDenug运行我的项目,但是我一直得到这个输出

Could not resolve all files for configuration ':app:mobileGoogleZappDebugCompileClasspath'.
> Could not resolve com.applicaster:GrandeFamily:0.3.+.
  Required by:
      project :app
   > Failed to list versions for com.applicaster:GrandeFamily.
      > Unable to load Maven meta-data from https://dl.bintray.com/applicaster-ltd/maven/com/applicaster/GrandeFamily/maven-metadata.xml.
         > Could not get resource 'https://dl.bintray.com/applicaster-ltd/maven/com/applicaster/GrandeFamily/maven-metadata.xml'.
            > java.lang.NullPointerException (no error message)

我在网上寻找答案,但大多数答案只是说要更改google()maven()jcenter()的顺序,但无济于事。

这是我的项目级别gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.2.0'
    repositories {
        google()
        jcenter()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'

        classpath 'com.google.android.gms:strict-version-matcher-plugin:1.0.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://maven.google.com' }
        maven { url 'https://jitpack.io' }
        maven {
            credentials{
                username System.getenv("MAVEN_USERNAME")
                password System.getenv("MAVEN_PASSWORD")
            }
            url 'https://dl.bintray.com/applicaster-ltd/maven'
        }
        maven {
            url "$rootDir/node_modules/react-native/android"
        }
        maven {
            url "$rootDir/.m2"
        }


        maven {
            url "https://dl.bintray.com/applicaster-ltd/maven_plugins"

        }
        maven {
            url "https://mvn.jwplayer.com/content/repositories/releases/"

        }
        maven {
            url "https://dl.bintray.com/applicaster-ltd/maven_plugins/"

        }
        maven { url 'https://github.com/applicaster/APLiveScreenPro7-RN.git' }

    }
}

/**
 * Auto-generated from .env build configuration.
 */
ext.dimensionsConfig = [
    "platform": "mobile", // ["google", "amazon"]
    "vendor": "google", // ["mobile", "tv"]
    "flavor": "zapp", // ["zapp", "quickbrick"]
]

/**
 * Order of dimensions is critical! platform > vendor > flavor
 */
ext.zappProductFlavors = [
    mobile:     "platform",
    tv:         "platform",
    google:     "vendor",
    amazon:     "vendor",
    zapp:       "flavor",
    quickbrick: "flavor",
]

ext.zappProductFlavorsMap = {
    zappProductFlavors.each { key, dim ->
        "${key}" { dimension "${dim}" }
    }
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                flavorDimensions dimensionsConfig.keySet() as String[]
                productFlavors zappProductFlavorsMap
            }

            /**
             * Reject all variants that are not relevant for the current build -
             * you should be left with two only, debug and release.
             * e.g.: "mobileGoogleZappDebug/Release" or "tvAmazonZappDebug/Release" etc.
             */
            android.variantFilter { variant ->
                for (flavor in variant.getFlavors()) {
                    if (flavor.name != dimensionsConfig[flavor.dimension]) {
                        variant.setIgnore(true)
                    }
                }
            }
        }
    }
}

这是我的应用程序级别的gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        applicationId "com.protvromania"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 273
        versionName "1.0.4-alpha.3"
        manifestPlaceholders = [
          app_name: "PROTV",
          fb_app_id: "1147926948637494",
        ]
        multiDexEnabled true
        renderscriptSupportModeEnabled true

        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'


    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    lintOptions {
        abortOnError false
    }

    dexOptions {
        jumboMode = true
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }

    packagingOptions {
        // Common
        pickFirst 'META-INF/NOTICE.txt'
        pickFirst 'META-INF/LICENSE.txt'
        pickFirst 'META-INF/LICENSE'
        pickFirst 'META-INF/ASL2.0'
        pickFirst 'META-INF/NOTICE'
        pickFirst 'META-INF/MANIFEST.MF'


        // https://github.com/ReactiveX/RxJava/issues/4445
        pickFirst 'META-INF/rxjava.properties'

        // This IMA hack is resolved with gradle wrapper version 2.3.3 - it's kept here for backward compatability - can be removed after a while.
        exclude 'jsr305_annotations/Jsr305_annotations.gwt.xml'
    }

    signingConfigs {
      release {
          storeFile file("../dist.keystore")
          storePassword ""
          keyAlias ""
          keyPassword ""
      }
    }

    buildTypes {
      debug {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          signingConfig signingConfigs.debug
      }
      release {
          minifyEnabled true
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          signingConfig signingConfigs.release
      }
    }

    /**
     * See top-level build.gradle for:
     * - Dimension configuration of the specific build
     * - All product flavors mapping
     */
    flavorDimensions dimensionsConfig.keySet() as String[]

    productFlavors zappProductFlavorsMap
}

/*
 * Create alias for the generated mobile flavors combination,
 * to keep backward compatibility without modifying CircleCI code.
 * e.g.: "apk/mobile/app-mobile-debug.apk" will actually point to "apk/mobileGoogleZapp/debug/app-mobile-google-zapp-debug.apk"
 */
ext.createMobileShortcut = { runtimeBuildType ->
    if (dimensionsConfig.platform == 'mobile') {
        def vendor = dimensionsConfig.vendor
        def flavor = dimensionsConfig.flavor
        def mobilePath = "app/build/outputs/apk/mobile/" + runtimeBuildType
        def apkPath = mobilePath + "/app-mobile-" + runtimeBuildType + ".apk"
        def compatibilityApkPath = "app/build/outputs/apk/app-mobile-" + runtimeBuildType + ".apk"
        def mobileApk = new File(apkPath)
        if (!mobileApk.exists()) {
            new File(mobilePath).mkdirs()
            def baseDirectory = System.getProperty("user.dir")
            def existingApkPath = baseDirectory + '/app/build/outputs/apk/mobile' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/app-mobile-' + vendor + '-' + flavor + '-' + runtimeBuildType + '.apk'
            ['ln', '-s', existingApkPath, apkPath].execute().waitFor()
            ['ln', '-s', existingApkPath, compatibilityApkPath].execute().waitFor()
            new File("app/build/outputs/mapping/mobile/" + runtimeBuildType).mkdirs()
            ['ln', '-s', baseDirectory + '/app/build/outputs/mapping/mobile' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/mapping.txt', 'app/build/outputs/mapping/mobile/' + runtimeBuildType + '/mapping.txt'].execute().waitFor()
        }
    }
}

/**
 * Create alias for the generated tv flavors combination, see example in createMobileShortcut
 */
ext.createTvShortcut = { runtimeBuildType ->
    if (dimensionsConfig.platform == 'tv') {
        def vendor = dimensionsConfig.vendor
        def flavor = dimensionsConfig.flavor
        def tvPath = "app/build/outputs/apk/tv/" + runtimeBuildType
        def apkPath = tvPath + "/app-tv-" + runtimeBuildType + ".apk"
        def tvApk = new File(apkPath)
        if (!tvApk.exists()) {
            new File(tvPath).mkdirs()
            ['ln', '-s', System.getProperty("user.dir") + '/app/build/outputs/apk/tv' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/app-tv-' + vendor + '-' + flavor + '-' + runtimeBuildType + '.apk', apkPath].execute().waitFor()
            new File("app/build/outputs/mapping/tv/" + runtimeBuildType).mkdirs()
            ['ln', '-s', System.getProperty("user.dir") + '/app/build/outputs/mapping/tv' + vendor.capitalize() + flavor.capitalize() + '/' + runtimeBuildType + '/mapping.txt', 'app/build/outputs/mapping/tv/' + runtimeBuildType + '/mapping.txt'].execute().waitFor()
        }
    }
}

ext.dimensionedBuildTaskName = { suffix ->
    def capitalizedDimensions = dimensionsConfig.inject([]) { r, v -> r << v.value.capitalize() }.join("")
    'assemble' + capitalizedDimensions + suffix.capitalize()
}

/**
 * Helper closure for creating paths - no more slash bugs
 */
ext.combinePaths = { paths ->
    if (paths in String) paths = [paths] // be nice and return a proper path also with a single String
    def file = new File("")
    paths.each { path ->
        file = new File(file.getPath(), path)
    }
    file.getPath()
}


task assembleMobileDebug() {
    dependsOn dimensionedBuildTaskName('debug')
    doLast {
      createMobileShortcut('debug')
    }
}

task assembleMobileRelease() {
    dependsOn dimensionedBuildTaskName('release')
    doLast {
      createMobileShortcut('release')
    }
}

task assembleTvDebug() {
    dependsOn dimensionedBuildTaskName('debug')
    doLast {
      createTvShortcut('debug')
    }
}

task assembleTvRelease() {
    dependsOn dimensionedBuildTaskName('release')
    doLast {
      createTvShortcut('release')
    }
}

if (System.getenv("CIRCLECI")) {
    android.signingConfigs.debug.storeFile = file("../debug.keystore")
}

dependencies {
    implementation ("com.applicaster:JWPlayerPlugin:1.5.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:GrandeFamily:0.3.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:ChagresFamily:0.3.2") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:LermaFamily:0.3.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:RhineFamily:0.4.4") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:BottomTabBarMenu-Android:5.1.0") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:FirebaseAnalyticsPlugin:2.3.0") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:DanubeFamily:0.4.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:DFP-Plugin:0.3.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:GoogleAnalyticsProvider:3.1.0") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:protv-login-plugin:0.2.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:ColoradoFamily:0.4.0") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:ElbeFamily:0.9.+") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }
    implementation ("com.applicaster:urbanAirship-Android:2.0.0") {
        exclude group:    'com.applicaster', module: 'applicaster-android-sdk'
        exclude group:    'com.applicaster', module: 'zapp-root-android'
    }

    api 'com.applicaster:applicaster-modular-sdk:100.0.0'
    implementation (project(':react-native-linear-gradient')) {
        exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
    }
implementation (project(':react-native-svg')) {
        exclude group: 'com.applicaster', module: 'applicaster-android-sdk'
    }


}

apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'

我完全迷路了,不知道是什么原因导致了此错误

1 个答案:

答案 0 :(得分:0)

尝试启用Embedded Maven存储库。转到“文件”>“设置”>“构建”>“ Gradle”>“ Android Studio” ...选中“启用嵌入式Maven存储库”