错误:来自[androidx.core:core:1.0.0]的属性application @ appComponentFactory value =(androidx.core.app.CoreComponentFactory) [英] Error: Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0]

查看:190
本文介绍了错误:来自[androidx.core:core:1.0.0]的属性application @ appComponentFactory value =(androidx.core.app.CoreComponentFactory)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究firebase-ml.

更早之前,我正在使用它的16版本,并且可以在我的项目中正常工作.但是在满足一些要求之后,我需要将其升级到21.0.0,然后面对

错误:属性application @ appComponentFactory值=(androidx.core.app.CoreComponentFactory)来自[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86也是出现在[com.android.support:support-compat:28.0.0]AndroidManifest.xml:22:18-91值=(android.support.v4.app.CoreComponentFactory).意见建议:添加'tools:replace ="android:appComponentFactory"'转换为元素在AndroidManifest.xml:86:5-430:19进行覆盖.

这是我正在使用的依赖项

 实现'com.google.firebase:firebase-ml-vision:21.0.0' 

有人解决了这个问题吗?

其他

  import java.text.SimpleDateFormatbuildscript {储存库{谷歌()maven {url'https://plugins.gradle.org/m2/'}}依赖项{classpath'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'}}应用插件:"com.onesignal.androidsdk.onesignal-gradle-plugin"储存库{maven {url'https://maven.google.com'}}buildscript {储存库{谷歌()maven {url'https://maven.fabric.io/public'}jcenter()}依赖项{//这些文档使用开放式版本,因此我们的插件//可以快速更新以响应Android工具更新类路径'com.android.tools.build:gradle:3.4.1'//我们建议将其从更新日志更改为最新版本://https://docs.fabric.io/android/changelog.html#fabric-gradle-pluginclasspath'io.fabric.tools:gradle:1.+'}}储存库{谷歌()//maven {url'https://maven.google.com'}jcenter()mavenCentral()}应用插件:"com.android.application"应用插件:"com.google.firebase.firebase-perf"应用插件:"io.fabric"储存库{maven {url'https://maven.fabric.io/public'}}储存库{maven {url'https://dl.bintray.com/intercom/intercom-maven'}}安卓 {lintOptions {abortOnError假}dexOptions {jumboMode = true}signingConfigs {配置{keyAlias'evalexpert_android_key'keyPassword'algo_driven_eval_expert'storeFile文件('/Users/nadkyxa/Code/EvalExpert/eval_expert.jks')storePassword'algo_driven_eval_expert'}}编译版本28buildToolsVersion '28 .0.3'defaultConfig {applicationId'xyz.AlgoDriven.EvalExpert'minSdkVersion 18targetSdkVersion 28版本号86versionName"8.0.4"multiDexEnabled true//重要manifestPlaceholders = [onesignal_app_id:"aa111770-4417-4674-b657-c91e40a3ff25",//从仪表板提取项目编号,忽略本地值.onesignal_google_project_number:"REMOTE"]externalNativeBuild {ndkBuild {定位积极"abiFilters"armeabi-v7a"}}}useLibrary'org.apache.http.legacy'externalNativeBuild {ndkBuild {路径"src/main/jni/Android.mk"}}buildTypes {释放 {minifyEnabled falseproguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'signingConfig signingConfigs.config}调试{externalNativeBuild {ndkBuild {参数"NDK_DEBUG:= 1"}}}}productFlavors {}包装选项{排除"META-INF/DEPENDENCIES"排除"META-INF/许可"排除"META-INF/LICENSE.txt"排除"META-INF/license.txt"排除"META-INF/NOTICE"排除"META-INF/NOTICE.txt"排除"META-INF/notice.txt"排除"META-INF/ASL2.0"排除"META-INF/ECLIPSE_.SF"排除"META-INF/ECLIPSE_.RSA"}configuration.all {resolutionStrategy {强制'androidx.media:media:1.0.0'}}}所有项目{储存库{谷歌()jcenter()专家{url"https://jitpack.io"}maven {url"https://s3.amazonaws.com/repo.commonsware.com"}//maven {url'https://dl.bintray.com/intercom/intercom-maven'}maven {url'https://maven.fabric.io/public'}mavenCentral()专家{网址"https://maven.google.com/"名称为"Google"}}}依赖项{def suppLibVersion = '28 .0.0'androidTestImplementation'androidx.test:runner:1.3.0-alpha01'androidTestImplementation'androidx.test.espresso:espresso-core:3.3.0-alpha01'实现('com.crashlytics.sdk.android:crashlytics:2.9.6@aar'){可传递=真;}实施('com.crashlytics.sdk.android:answers:1.3.7@aar'){可传递=真;}实施项目(':UrlImageViewHelper')实施项目(':TwoWayGridView')实施项目(':SlidingMenu')实施项目(':Branch-Invite-SDK')实施('com.google.android.gms:play-services-base:17.0.0'){力=真;}实施('com.google.android.gms:play-services-maps:17.0.0'){力=真;}//Firebase实施'com.google.firebase:firebase-core:17.0.0'实施'com.google.firebase:firebase-perf:18.0.1'实施'com.google.firebase:firebase-database:18.0.0'实施'com.google.firebase:firebase-auth:18.0.0'实施'com.google.firebase:firebase-messaging:19.0.1'实施'com.google.firebase:firebase-ml-vision:21.0.0'//OneSignal&推送通知实现('com.onesignal:OneSignal:3.10.8'){排除组:"com.google.android.gms"}实现'me.leolin:ShortcutBadger:1.1.22@aar'//对讲机实现'io.intercom.android:intercom-sdk-base:5.+'实现'io.intercom.android:intercom-sdk-fcm:5.+'实现'com.android.support:recyclerview-v7:'+ suppLibVersion实现'com.android.support:gridlayout-v7:'+ suppLibVersion实现'com.android.support:support-v4:'+ suppLibVersion实现'com.android.support:design:'+ suppLibVersion实现"uk.co.chrisjenx:书法:2.1.0"实现'com.nostra13.universalimageloader:universal-image-loader:1.9.4'实施'com.koushikdutta.ion:ion:2. +'实现'com.github.JakeWharton:ViewPagerIndicator:2.4.1'实现'com.github.jaydeepw:poly-picker:v1.0.22'实现'com.readystatesoftware.sqliteasset:sqliteassethelper:+'实施'com.daimajia.swipelayout:library:1.2.0@aar'实施'commons-io:commons-io:2.5'实施'com.jsibbold:zoomage:1.1.0'实现'com.wootric:wootric-sdk-android:2.5.2'testImplementation'junit:junit:4.13-beta-3'实现'io.branch.sdk.android:library:2.+'实施'com.github.bumptech.glide:glide:3.8.0'实现'info.hoang8f:android-segmented:1.0.6'实施'com.otaliastudios:cameraview:1.6.0'实现'com.github.eventtus:photo-editor-android:v1.0'实现'com.nineoldandroids:library:2.4.0'实现'com.theartofdev.edmodo:android-image-cropper:2.7.+'//实施'com.applozic.communication.uiwidget:mobicomkitui:5.34'实施项目(':mobicomkit')实施项目(':mobicomkitui')实施项目(':mobicommons')实施'com.google.android.material:material:1.0.0'}应用插件:"com.google.gms.google-services" 

解决方案

此处的问题是您的项目没有完全迁移到AndroidX.[com.android.support:support-compat:28.0中存在冲突.0]和androidx.core:core:1.0.0版本.

将com.android.support:support库更新为

 实现"androidx.core:core:1.0.0" 

有关更多信息,请参考此指南:

I am working on the firebase-ml.

Earlier, I am using the 16 version of it and its working fine with my project. But after some requirements, I need to upgrade it to 21.0.0, and then I am facing the

Error: Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:86:5-430:19 to override.

Here is the dependency which I am using

implementation 'com.google.firebase:firebase-ml-vision:21.0.0'

Did anybody resolve this issue?

Additional

import java.text.SimpleDateFormat

buildscript {
    repositories {
        google()
        maven { url 'https://plugins.gradle.org/m2/'}
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
    }
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
    maven { url 'https://maven.google.com' }
}

buildscript {
    repositories {
        google()
        maven { url 'https://maven.fabric.io/public' }
        jcenter()
    }

    dependencies {
        // These docs use an open ended version so that our plugin
        // can be updated quickly in response to Android tooling updates
        classpath 'com.android.tools.build:gradle:3.4.1'
        // We recommend changing it to the latest version from our changelog:
        // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

repositories {
    google()
    //maven { url 'https://maven.google.com' }
    jcenter()
    mavenCentral()
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

repositories {
    maven { url 'https://dl.bintray.com/intercom/intercom-maven' }
}


android {

    lintOptions {
        abortOnError false
    }

    dexOptions {
        jumboMode = true
    }
    signingConfigs {
        config {
            keyAlias 'evalexpert_android_key'
            keyPassword 'algo_driven_eval_expert'
            storeFile file('/Users/nadkyxa/Code/EvalExpert/eval_expert.jks')
            storePassword 'algo_driven_eval_expert'
        }
    }
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId 'xyz.AlgoDriven.EvalExpert'
        minSdkVersion 18
        targetSdkVersion 28
        versionCode 86
        versionName "8.0.4"

        multiDexEnabled true //important

        manifestPlaceholders = [onesignal_app_id: "aa111770-4417-4674-b657-c91e40a3ff25",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: "REMOTE"]

        externalNativeBuild {
            ndkBuild {
                targets "ocrnative"
                abiFilters "armeabi-v7a"
            }
        }
    }

    useLibrary 'org.apache.http.legacy'

    externalNativeBuild {
        ndkBuild {
            path "src/main/jni/Android.mk"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
        debug {
            externalNativeBuild {
                ndkBuild {
                    arguments "NDK_DEBUG:=1"
                }
            }
        }
    }
    productFlavors {
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/ECLIPSE_.SF'
        exclude 'META-INF/ECLIPSE_.RSA'
    }
    configurations.all {
        resolutionStrategy {
            force 'androidx.media:media:1.0.0'
        }
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
        //   maven { url 'https://dl.bintray.com/intercom/intercom-maven' }
        maven { url 'https://maven.fabric.io/public' }

        mavenCentral()

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}
dependencies {
    def suppLibVersion = '28.0.0'

    androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'


    implementation('com.crashlytics.sdk.android:crashlytics:2.9.6@aar') {
        transitive = true;
    }
    implementation('com.crashlytics.sdk.android:answers:1.3.7@aar') {
        transitive = true;
    }
    implementation project(':UrlImageViewHelper')
    implementation project(':TwoWayGridView')
    implementation project(':SlidingMenu')
    implementation project(':Branch-Invite-SDK')
    implementation('com.google.android.gms:play-services-base:17.0.0') {
        force = true;
    }

    implementation('com.google.android.gms:play-services-maps:17.0.0') {
        force = true;
    }
    // Firebase
    implementation 'com.google.firebase:firebase-core:17.0.0'

    implementation 'com.google.firebase:firebase-perf:18.0.1'
    implementation 'com.google.firebase:firebase-database:18.0.0'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'

    implementation 'com.google.firebase:firebase-ml-vision:21.0.0'
    // OneSignal & Push Notify
    implementation('com.onesignal:OneSignal:3.10.8') {
        exclude group: 'com.google.android.gms'
    }
    implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
    // Intercom
    implementation 'io.intercom.android:intercom-sdk-base:5.+'
    implementation 'io.intercom.android:intercom-sdk-fcm:5.+'
    implementation 'com.android.support:recyclerview-v7:' + suppLibVersion
    implementation 'com.android.support:gridlayout-v7:' + suppLibVersion
    implementation 'com.android.support:support-v4:' + suppLibVersion
    implementation 'com.android.support:design:' + suppLibVersion
    implementation 'uk.co.chrisjenx:calligraphy:2.1.0'
    implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
    implementation 'com.koushikdutta.ion:ion:2.+'
    implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
    implementation 'com.github.jaydeepw:poly-picker:v1.0.22'
    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
    implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
    implementation 'commons-io:commons-io:2.5'
    implementation 'com.jsibbold:zoomage:1.1.0'
    implementation 'com.wootric:wootric-sdk-android:2.5.2'
    testImplementation 'junit:junit:4.13-beta-3'
    implementation 'io.branch.sdk.android:library:2.+'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'info.hoang8f:android-segmented:1.0.6'
    implementation 'com.otaliastudios:cameraview:1.6.0'
    implementation 'com.github.eventtus:photo-editor-android:v1.0'
    implementation 'com.nineoldandroids:library:2.4.0'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
    //    implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.34'
    implementation project(':mobicomkit')
    implementation project(':mobicomkitui')
    implementation project(':mobicommons')
    implementation 'com.google.android.material:material:1.0.0'
}

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

解决方案

The problem here is that your project is not completely migrated to Android X. There is a conflict in [com.android.support:support-compat:28.0.0] and the androidx.core:core:1.0.0 version.

Update com.android.support:support libraries to

implementation "androidx.core:core:1.0.0"

Refer to this guide for More: https://developer.android.com/jetpack/androidx/migrate

https://developer.android.com/jetpack/androidx

Update: Try to migrate project to Android X. Attaching the screenshot how to do it. After this invalidate cache and restart.

这篇关于错误:来自[androidx.core:core:1.0.0]的属性application @ appComponentFactory value =(androidx.core.app.CoreComponentFactory)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆