gpt4 book ai didi

android - 添加 firebase 依赖项后无法构建项目

转载 作者:行者123 更新时间:2023-11-29 22:55:37 25 4
gpt4 key购买 nike

<分区>

我正在尝试测试 FCM,但在添加 firebase-messaging 依赖项后,该应用无法构建。我收到了一些类似“警告:API 'variant.getMergeResources()' 已过时并已被 'variant.getMergeResourcesProvider()' 取代的警告。它将在 2019 年底被删除。”

我得到的错误是:

"Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='appcompat-v7', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.slidingpanelayout', myArtifactId='slidingpanelayout', myVersion='1.0.0', myPacking='aar', myClassifier='null'}...

在线:

implementation 'com.android.support:appcompat-v7:28.0.0'

我尝试了一种解决方案,该解决方案涉及向 gradle 文件添加一些“configurations.all”选项,但没有奏效。我试过将 firebase 的版本更改为较早的版本,但这也不起作用。

这是我构建的模块级 build.gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hfad.fcm"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
}

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

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