简体   繁体   English

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

[英]Gradle Sync Failed (Android Studio) Because of Snapshot Dependencies (?)

I have a problem already for a long time. 我已经有很长时间了。 My Gradle sync in Android studio always fails. Android Studio中的我的Gradle同步始终失败。 It seems like that I have mixed up dependencies... The error message is always the same: 似乎我混淆了依赖性...错误消息始终是相同的:

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

This is how my build gradle looks like with the marked dependencies 这是带有标记依赖项的构建gradle的样子

在此处输入图片说明

The red marked line is about the mixed dependencies ( 28.0.0 and 28.0.0-rc2 ) The other ones marked in green just tell that there is a newer version available. 红色标记线表示混合的依赖项( 28.0.028.0.0-rc2 ),其他标记为绿色的行表示存在可用的较新版本。 As SDKs I have installed 28.0.0 , 28.0.0-rc2 and 27.0.3 . 作为软件开发工具包我已经安装了28.0.028.0.0-rc227.0.3 If I deinstall 27.0.3 an error appears with the message 27.0.3 is needed... (And I have no idea why) 如果我卸载27.0.3 ,则会出现错误消息, 27.0.3需要27.0.3 ...(而且我也不知道为什么)

This is my build.gradle file ... 这是我的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") } } } } 

Somewhere you used 28.0.0-rc02 and somewhere you used 28.0.0 . 您在某处使用28.0.0-rc02而在某处使用28.0.0 it's a wrong way! 这是错误的方式!

Try to change all 28.0.0-rc02 with 28.0.3 尝试将所有28.0.0-rc02更改为28.0.3

it warns you to use the last version. 它警告您使用最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM