Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android studio 清单合并失败的android studio_Android Studio - Fatal编程技术网

Android studio 清单合并失败的android studio

Android studio 清单合并失败的android studio,android-studio,Android Studio,我的版本中有这个。gradlemodule:app: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat:28.0.0' implementation 'com.android.support:design:28.0.0' implementation 'com.android.su

我的版本中有这个。gradlemodule:app:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint- 
                    layout:1.1.3'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-database:16.0.4'
                    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:recyclerview-v7:28.0.0'
    implementation 'com.android.support:gridlayout-v7:28.0.0'
}
当我尝试同步时,它会显示以下内容:

ERROR: 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] 
AndroidManifest.xml:22:18-86 value= 
(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to 
<application> element at AndroidManifest.xml:9:5-32:19 to override.
什么会导致这种情况?我该如何修复它

将tools:replace=android:appComponentFactory添加到清单中不起作用

您的android图像裁剪器库正在使用androidx,而您尚未迁移。强烈建议这样做,因为大多数库都是这样做的,并且可能不会提供对com.android.support变体的向后兼容性


如果短期内无法迁移,则可以恢复到库的较低版本。根据,他们在2.8.0中迁移到AndroidX,所以你应该回到2.7.0版。

我已经尝试降级到2.7.0版,甚至完全删除了库。我还没有使用它,但它仍然给了我一个错误:错误:无法解析:com.android.support:appcompat:28.0.0尝试使用gradle生成依赖关系树一些提到的方法,并检查其他库是否也使用androidx。如果他们这样做,它将与您的支持库冲突。迁移到androidx应该可以解决所有问题,对吗?出于某种原因,请按折射器>迁移到androidx。。。没有什么能解决的。请遵循我链接的迁移指南,记住他们的自动化解决方案并不完美,因此您可能需要手动更改某些内容。你应该能够在网上找到一些关于如何做到这一点的资源,包括其他问题