由于快照依赖性,Gradle同步失败(Android Studio)

时间:2018-12-07 15:09:37

标签: java android maven android-studio gradle

我已经有很长时间了。我在Android Studio中的Gradle同步始终失败。 错误消息始终是相同的:

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.vt:cort-commons:0.0.1-SNAPSHOT.
Open File
Show Details


Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.vt:cort-ws-model:0.0.1-SNAPSHOT.
Open File
Show Details

这是我的build.gradle文件...

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

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

apply plugin: 'maven'

android {
    compileSdkVersion 28
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId "com.vt.cort"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 5
        versionName "5.0"
        multiDexEnabled true
    }

    signingConfigs {
        debug {
            storeFile file(System.getProperty("user.home") + "/.android/debug.keystore")
            storePassword 'android'
        }
        release {
            storeFile file("../cort.keystore")
            storePassword 'xxx'
            keyAlias 'xxx
            keyPassword 'xxx'
        }
        playstore {
            storeFile file("../cort-play-upload.keystore")
            storePassword 'xxx'
            keyAlias 'xxx'
            keyPassword 'xxx'
        }
    }

    buildTypes {
        debug {
            debuggable true
            minifyEnabled false
            shrinkResources false
            //proguard-android.txt is present in the platform sdk
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.debug
        }
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            //proguard-android.txt is present in the platform sdk
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }

        playstore {
            debuggable false
            minifyEnabled true
            shrinkResources true
            //proguard-android.txt is present in the platform sdk
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.playstore
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:exifinterface:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'

    implementation 'com.android.support:mediarouter-v7:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-perf:16.2.2'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'org.jetbrains:annotations:16.0.2'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.11.0'
    implementation 'com.squareup:otto:1.3.8'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.github.japgolly.android:svg-android:2.0.6'
    //No updates available on this since Mar, 2014
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    // No updates are available on this since Oct, 2015
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
    implementation 'com.facebook.android:facebook-android-sdk:4.38.0'
    implementation 'com.vt:cort-commons:0.0.1-SNAPSHOT@jar'
    implementation 'com.vt:cort-ws-model:0.0.1-SNAPSHOT@jar'
}

apply plugin: 'com.google.gms.google-services'

artifacts {
    archives file : file('build/outputs/apk/release/app-release.apk')
}

uploadArchives {
    repositories {
        mavenDeployer {
            pom.groupId = "com.vt.cort"
            pom.artifactId = 'cort'
            pom.version  = '1.0-SNAPSHOT'
            repository(url: "http://localhost:4080/nexus/content/repositories/elm-repository") {
                authentication(userName: "admin1", password: "admin123")
            }
        }
    }
}

它总是在使用ANdroid Studio构建过程中发生。如果我同时禁用了两个快照依赖关系,则该构建有效,但这当然会破坏APK。

0 个答案:

没有答案