错误:来自[androidx.core:core:1.0.0]

时间:2019-07-08 06:35:15

标签: android firebase firebase-mlkit

我正在研究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进行覆盖。

这是我正在使用的依赖项

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

有人解决了这个问题吗?

其他

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'

1 个答案:

答案 0 :(得分:0)

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

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

implementation "androidx.core:core:1.0.0"

有关更多信息,请参阅本指南:https://developer.android.com/jetpack/androidx/migrate

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

更新:尝试将项目迁移到AndroidX。请附上截图以进行操作。此操作后,使缓存无效并重新启动。 enter image description here