gpt4 book ai didi

android project in ... 'app' 已解决的 Google Play 服务库依赖依赖于另一个确切版本

转载 作者:行者123 更新时间:2023-11-29 22:35:54 24 4
gpt4 key购买 nike

我有一个应用程序运行良好,但今天在构建项目时出现错误。我花了一整天的时间从堆栈中尝试了太多的解决方案。没有任何效果。

我有以下应用 -> build.gradle

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

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.myapp.immuno"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
aaptOptions.cruncherEnabled = false // here
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.google.code.gson:gson:2.8.5'

// Firebase libraries
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'

// circular image
implementation 'de.hdodenhof:circleimageview:2.2.0'

// RecyclerView
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:28.0.0'
//FacebookSdk
//implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
//implementation 'com.facebook.android:facebook-login:4.37.0'

// volley library
implementation 'com.android.volley:volley:1.1.1'

implementation 'com.google.android.gms:play-services:17.0.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'

// Glide library to load images smoothly
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'

// To get date and time
implementation 'net.danlew:android.joda:2.10.1.1'

// external libraries for mail
implementation files('libs/activation.jar')
implementation files('libs/additionnal.jar')
implementation files('libs/mail.jar')

// Add the Fabric Crashlytics plugin.
//classpath 'io.fabric.tools:gradle:1.31.2'
// Add the Firebase Crashlytics dependency.
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'


}

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

build.gradle 是

buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
classpath 'io.fabric.tools:gradle:1.31.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

在构建项目时我遇到了这个错误

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[20.0.2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.firebase:firebase-messaging:20.1.0 -> com.google.firebase:firebase-iid@[20.0.2], but firebase-iid version was 19.0.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.firebase:firebase-iid@{strictly 19.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-core@17.2.1
-- Project 'app' depends onto com.google.firebase:firebase-crash@16.2.1
-- Project 'app' depends onto com.google.firebase:firebase-messaging@{strictly 20.1.0}
-- Project 'app' depends onto com.google.firebase:firebase-messaging@20.1.0
-- Project 'app' depends onto com.google.firebase:firebase-crash@{strictly 16.2.1}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@17.2.1
-- Project 'app' depends onto com.google.firebase:firebase-core@{strictly 17.2.1}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 17.2.1}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 17.2.1}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file.

最佳答案

以下是我执行的步骤和解决的问题:

  1. 我将 com.google.firebase:firebase-messaging:20.1.0 更改为 com.google.firebase:firebase-messaging:20.0.1
  2. 同步gradle
  3. 并回滚更改(将 20.0.1 更改为 20.1.0)
  4. 如果同步并运行应用程序,您会发现问题已解决!

我知道这不是正确的方法,但解决了我的问题。任何正确的都应该被替换。

关于android project in ... 'app' 已解决的 Google Play 服务库依赖依赖于另一个确切版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59510209/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com