gpt4 book ai didi

android - 库 com.google.android.gms :play-services-basement is being requested by various other libraries at [[15. 0.1,15.0.1]],但解析为 16.0.1

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:17:20 31 4
gpt4 key购买 nike

同步项目时出现此错误:

The library com.google.android.gms:play-services-basement is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 16.0.1.

Disable the plugin and check your dependencies tree using ./gradlew
:app:dependencies
.

这是我的build.gradle项目文件:

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

buildscript {

repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}

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

这是我的 build.gradle 应用文件:

import com.google.gms.googleservices.GoogleServicesPlugin

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

android {
compileSdkVersion 27
defaultConfig {
multiDexEnabled true
applicationId "com.example.myexampleapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 13
versionName "0.1.13"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'

我尝试过的:

感谢您的帮助!

更新:这是我目前在我的依赖项中的内容:

dependencies {
api "com.android.support:appcompat-v7:28.0.0"
api "com.android.support:customtabs:28.0.0"
api "com.android.support:support-v4:28.0.0"
api "com.android.support:cardview-v7:28.0.0"
api "com.android.support:design:28.0.0"
api "com.android.support.constraint:constraint-layout:1.1.3"

api "com.crashlytics.sdk.android:crashlytics:2.9.5"
api "com.google.android.gms:play-services-base:16.0.1"
api "com.google.android.gms:play-services-auth:16.0.1"

api "com.google.firebase:firebase-core:16.0.5"
api "com.google.firebase:firebase-auth:16.0.5"
api ("com.google.firebase:firebase-firestore:17.1.2") {
exclude group: "com.squareup.okhttp", module: "okhttp"
}
api ("com.firebaseui:firebase-ui-firestore:4.1.0") {
exclude group: "com.google.code.gson", module: "gson"
}
api ("com.firebaseui:firebase-ui-auth:4.1.0") {
exclude group: "com.google.code.gson", module: "gson"
}
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

这是我得到的错误:

error: cannot find symbol class IFlagProvider

最佳答案

这些依赖项使其构建:

dependencies {
implementation "com.android.support:appcompat-v7:28.0.0"
implementation "com.android.support:customtabs:28.0.0"
implementation "com.android.support:support-v4:28.0.0"
implementation "com.android.support:cardview-v7:28.0.0"
implementation "com.android.support:design:28.0.0"
implementation "com.android.support.constraint:constraint-layout:1.1.3"

implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-auth:16.0.1"

implementation "com.crashlytics.sdk.android:crashlytics:2.9.5"

implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-auth:16.0.4"

implementation ("com.google.firebase:firebase-firestore:18.0.0") {
exclude group: "com.squareup.okhttp", module: "okhttp"
exclude group: "com.google.code.gson", module: "gson"
// exclude group: "com.google.guava", module: "guava"
}

implementation ("com.firebaseui:firebase-ui-firestore:4.1.0") {
exclude group: "com.google.code.gson", module: "gson"
}

implementation ("com.firebaseui:firebase-ui-auth:4.1.0") {
exclude group: "com.google.code.gson", module: "gson"
}
}

我添加了 customtabs:28.0.0 以满足所需的版本和 play-services-base:16.0.0 (应该作为传递依赖获取) .还排除了重复的包,例如。 gson。使用 compileSdkVersiontargetSdkVersion 28.

关于android - 库 com.google.android.gms :play-services-basement is being requested by various other libraries at [[15. 0.1,15.0.1]],但解析为 16.0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52882056/

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