【发布时间】:2019-08-09 22:57:29
【问题描述】:
我正在尝试测试 FCM,但在添加了 firebase-messaging 依赖项后,应用无法构建。我收到“警告:API 'variant.getMergeResources()' 已过时并已替换为'variant.getMergeResourcesProvider()' 的警告。 它将在 2019 年底被删除。”
我得到的错误是:
"使用groupId com.android.support 和androidx.* 的依赖不能 合而为一 IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='appcompat-v7', myVersion='28.0.0', myPacking='aar', myClassifier='null'} 和 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'
【问题讨论】:
标签: android firebase android-studio android-support-library androidx