我还有下一年级

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    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.android.material:material:1.0.0-rc01'
}

但当我想要构建应用程序时,我得到下一个日志:

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0-alpha3] 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:5:5-19:19 to override.

好!去显化并去做:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="ru.chopcode.myapplication">

    <application
        tools:replace="android:appComponentFactory"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    </application>

</manifest>

然后我在我的Logcat中得到这个错误:

Manifest merger failed with multiple errors, see logs that I have Linked with it

当前回答

改变你的构建。Gradle依赖到

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

or

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

其他回答

看到这张图片并在你的android AndroidManifest.xml中添加这一行

tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"

遵循以下步骤:

去重构和点击迁移到AndroidX 单击执行重构

如果您正在使用电容,请在package.json中升级到电容/core 2.0.1或更高版本

把机器人移走。支持依存关系

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

引用材料指南

如果你还不想切换到新的androidx和com.google.android.material包,你可以通过com.android.support:design:28.0.0-alpha3依赖使用Material Components。 注意:你不应该在你的应用程序中同时使用com.android.support和com.google.android.dependencies。

仅仅删除这个依赖就可以了

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

这是一个完整的依赖示例

    dependencies {
       implementation fileTree(dir: 'libs', include: ['*.jar'])
       implementation 'com.google.android.material:material:1.0.0-beta01'
       implementation 'com.android.support.constraint:constraint-layout:1.1.2'
       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'
   }

我所做的就是转到顶部菜单上的“重构”选项。

然后选择“迁移到AndroidX”

接受将项目保存为zip文件。

请更新Android Studio和Gradle,以确保没有遇到任何问题。