以下是输出控制台中弹出的错误。总是弹出新的错误。打开任何类文件时,R 上出现错误。无法解析符号 R。请帮助我。
Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0-alpha3] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:7:5-74:19 to override.
跟随项目的app:Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.lenovo.skanda"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha1"
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.android.support:cardview-v7:28.0.0'
implementation 'com.github.msayan:tutorial-view:v1.0.6'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
implementation 'com.firebaseui:firebase-ui-database:0.4.0'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.2.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'org.greenrobot:eventbus:3.0.0'
//Library for Expendable Text View
implementation 'com.ms-square:expandableTextView:0.1.4'
implementation 'me.biubiubiu.justifytext:library:1.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.airbnb.android:lottie:2.0.0'
implementation 'com.android.support:design:28.0.0'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
非常感谢您在此事上花费的时间和提供的帮助。
最佳答案
这是因为您的以下依赖项:
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha1"
与以下内容发生冲突:
implementation 'com.android.support:appcompat-v7:28.0.0'
因为它们都有相同的属性:
<小时/>Attribute application@appComponentFactory
您可以通过使用 ConstraintLayout 的支持版本来解决该问题:
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
或者使用 AndroidX 库更改所有支持库。
关于java - 项目中的 list 合并失败问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53161850/