清单合并失败 1

Manifest merger failed1

我改了sdk,出现如下错误。 我有下一年级了。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
//    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "itservice.protocol"
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 2
        versionName "2.0"
        testInstrumentationRunner "android.support.moveBattalion.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':core')
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.mikhaellopez:circularimageview:3.0.2'
    /**
     * Butter knife binder
     */
    implementation 'com.jakewharton:butterknife:8.5.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
    /**
     *
     */
    implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
    /**
     * Picasso image downloading library
     */
    implementation 'com.squareup.picasso:picasso:2.71828'
    /**Location Services*/
    implementation 'com.google.android.gms:play-services-location:17.1.0'
    testImplementation 'junit:junit:4.12'
//    implementation 'com.android.support:design:25.4.0'
    implementation 'com.yandex.android:maps.mobile:4.0.0-full'
}

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

清单合并失败:属性 application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) 来自 [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91

清单文件:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="itservice"
    android:versionCode="2">

    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <application
        android:name="itservice.MainApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name="itservice.activity.LoginActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="itservice.activity.MainActivity"
            android:label="@string/app_name"
            android:noHistory="true"
            android:theme="@style/AppTheme.NoActionBar" />

        <service android:name="itservice.service.GpsService" />
    </application>

</manifest>

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

我的建议,切换到AndroidX

重构 > 从菜单栏迁移到 AndroidX