'tools:replace=“android:allowBackup”'到元素

'tools:replace=“android:allowBackup”'到元素,android,build,androidx,Android,Build,Androidx,我在添加实现“com.github.MdFarhanRaja:SearchableSpinner:2.0”时遇到问题 警告我 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:20:5-123:19 to override. 这是给 'tools:replace="android:allowBackup" 用这个 新的错误显示和建议给我 Manifest me

我在添加实现“com.github.MdFarhanRaja:SearchableSpinner:2.0”时遇到问题 警告我

'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:20:5-123:19 to override.
这是给

'tools:replace="android:allowBackup"
用这个 新的错误显示和建议给我

Manifest merger failed : Attribute application@appComponentFactory value=(whateverString) from AndroidManifest.xml:22:9-53
    is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:20:5-123:19 to override.
这是我的项目建设


正如在评论中提到的,您正在使用依赖于支持库的第三方库,并且您正在项目中使用AndroidX。这可以使用Jetifier进行修复:

转到gradle.properties文件并添加以下行:

android.enableJetifier=true

android.enableJetifier:设置为true时,此标志表示您希望从android Gradle插件获得工具支持,以自动转换现有的第三方库,就像它们是为AndroidX编写的一样。如果没有该标志,Android Studio的行为就好像该标志被设置为false一样

如果这仍然导致错误,请使用从重构菜单迁移到AndroidX,它会自动修复此问题

在android:allowBackup=false之后添加工具:replace=android:allowBackup。
在mainfest文件中使用此代码以关闭此问题。

能否显示build.gradle?我假设您在项目中使用的是androidx依赖项,虽然lib com.github.MdFarhanRaja:SearchableSpinner:2.0使用的是com.android.support:appcompat,但不能同时使用androidx依赖项和com.android.support:appcompattogather@ZohaibAmir我添加了我的构建。gradle@NileshRathod是的,你现在在,我在用androidx@hirose问题解决了吗?我已经在我的gradle.properties,但这是同一个问题me@Hirose使用“迁移到AndroidX”按钮错误:清单合并失败:属性application@allowBackupAndroidManifest.xml:21:9-36中的value=false也出现在[com.github.MdFarhanRaja:SearchableSpinner:2.0]AndroidManifest.xml:12:9-35 value=true中。建议:将“tools:replace=android:allowBackup”添加到AndroidManifest.xml:20:5-123:19处的元素以覆盖。@Hirose完成删除allowBackup并替换,然后尝试重新迁移您的意思是只需像这样离开“tools:android:”??
'tools:replace="android:allowBackup"
Manifest merger failed : Attribute application@appComponentFactory value=(whateverString) from AndroidManifest.xml:22:9-53
    is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:20:5-123:19 to override.
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.blogapp"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

        }
    }

    compileOptions {

        sourceCompatibility JavaVersion.VERSION_1_8

        targetCompatibility JavaVersion.VERSION_1_8

    }
}

dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:animated-vector-drawable:28.0.0'//
    implementation 'com.android.support:exifinterface:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3' //있고 ㅇㅇ


    //Expandable 프래그먼트 goodbyepet selectmenu
    implementation 'com.thoughtbot:expandablerecyclerview:1.3'
    implementation 'com.thoughtbot:expandablecheckrecyclerview:1.4'


    //유튜브 강의 3 추가함
    //1장에서 설정한거 추가


    //1장에서 설정한거 추가
    implementation 'com.jakewharton:butterknife:8.8.1'
    //유튜브 강의 3 추가함


    // firebase core

    implementation 'com.google.firebase:firebase-core:16.0.9'

    // firebase auth
    implementation 'com.google.firebase:firebase-auth:17.0.0'

    // firebase storage
    implementation 'com.google.firebase:firebase-storage:17.0.0'

    // firebase realtime database
    implementation 'com.google.firebase:firebase-database:17.0.0'

    implementation "com.wdullaer:materialdatetimepicker:3.6.4"


    implementation 'com.android.support:support-v13:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'

    //photo control
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'

    // card view
    implementation 'com.android.support:cardview-v7:28.0.0'

    // swipe cards for petching
    implementation 'com.lorentzos.swipecards:library:1.0.9'

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    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'  //있고 ㅇㅇ

    // Design library for Coordinator Layout and Toolbars
    implementation 'com.android.support:design:28.0.0'

    // circle design
    implementation 'de.hdodenhof:circleimageview:3.0.0'

    // rectangle design
    implementation 'com.github.siyamed:android-shape-imageview:0.9.3@aar'

    // bumptech/glide
    implementation 'com.github.bumptech.glide:glide:4.9.0'

    //picaso/glide
    implementation 'com.squareup.picasso:picasso:2.71828'

    // Edit Text
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'

    // lombok 사용
    compileOnly 'org.projectlombok:lombok:1.18.8'
    annotationProcessor 'org.projectlombok:lombok:1.18.8'
    implementation 'com.android.support:gridlayout-v7:28.0.0'

    // User Map
    implementation 'com.android.support:appcompat-v7:28.0.0'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'

    implementation 'com.google.android.gms:play-services-maps:16.1.0'

    implementation 'com.google.android.gms:play-services-location:16.0.0'

    implementation 'com.google.android.gms:play-services-places:16.1.0'

    implementation 'noman.placesapi:placesAPI:1.1.3'

    implementation 'com.thoughtbot:expandablecheckrecyclerview:1.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 'org.jetbrains:annotations-java5:15.0'


    //Calendar

    implementation 'joda-time:joda-time:2.10.1'


    // LifeCycle online or offline 여부 판별
    implementation "android.arch.lifecycle:extensions:1.1.1"

    // retrofit2 통신 라이브러리
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    implementation 'androidx.annotation:annotation:1.1.0'

    //calendar view
    implementation 'com.github.prolificinteractive:material-calendarview:1.5.0'


    // Searchable Spinner



}

apply plugin: 'com.google.gms.google-services'

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'
        // radio button
        classpath 'lib.kingja.switchbutton:switchbutton:1.1.8'
        classpath 'com.android.support:appcompat-v7:28.0.0'
        classpath 'com.google.android.gms:play-services-maps:17.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}