工具:replace="android:appComponentFactory 错误

堆栈工程师

当我尝试运行该应用程序时,出现以下错误。我该怎么做才能解决这个问题?

来自 [com.android.support:support-compat:28.0.0] 的属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) AndroidManifest.xml:22:18-91 也存在于 [androidx.core :core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). 建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:9:5-31:19 的元素以覆盖。

有关清单合并的更多信息,请参阅 ...。

FAILURE:构建失败,出现异常。

出了什么问题:任务 ':app:processDebugManifest' 执行失败。清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 也存在于[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). 建议:将 'tools:replace="android:appComponentFactory"' 添加到 AndroidManifest.xml:9:5-31:19 的元素以覆盖。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="stechome.berkeylen.firebasedatabase">
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT"/>
    <uses-feature android:name="android.hardware.camera2" />

    <application
        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">


        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>

        <activity android:name=".RvActivity"/>
        <activity android:name=".QRCodeScanner"/>
        <activity android:name=".ContactActivity"/>
        <activity android:name=".RoomsActivity"/>

    </application>

</manifest>
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "..."
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
configurations.all {
    resolutionStrategy.force 'com.android.support:support-v4:28.0.0'
    // the above lib may be old dependencies version
}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.firebaseui:firebase-ui:0.4.3'
    implementation 'com.dlazaro66.qrcodereaderview:qrcodereaderview:2.0.3'
    implementation 'com.miomin:shswiperefreshlayout:1.3.0'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'me.dm7.barcodescanner:zxing:1.9'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0-rc01'

    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    compileOnly 'com.google.android.things:androidthings:0.7-devpreview'
    implementation 'com.google.firebase:firebase-database:17.0.0'
    // Required only if Facebook login support is required
    testİmplementation 'junit:junit:4.12'
    androidTestİmplementation 'com.android.support.test:runner:1.0.2'
    androidTestİmplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:mediarouter-v7:28.0.0'
}
哈里斯·拉瓦尔

将您的库更新到 AndroidX ,转到菜单重构 - 迁移到 androidx。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章