简体   繁体   English

添加Firebase ML-kit时相关性冲突

[英]Dependencies conflict when adding firebase ML-kit

I am getting the following conflict in dependencies in app gardle while adding the firebase ml kit. 添加firebase ml套件时,我在应用程序gardle中的依赖项中遇到以下冲突。 Don't know how to resolve this ? 不知道该如何解决?

依赖冲突

Is this just a warning message or stopping you from build success ? 这仅仅是警告消息还是使您无法成功构建?

Anyways excluding com.android.support works as it worked for me in my project. 无论如何,除了com.android.support之外,它都可以在我的项目中为我工作。

Posting my gradle important bits and pieces from my project which uses ml-kit with targetSDK 28 and hope these changes works for you too. 将我的gradle重要片段从我的项目中发布,该项目使用了带有targetSDK 28的ml-kit,希望这些更改对您也有用。

Module gradle: 模块gradle:

    android{

    defaultConfig {

            /.. bla bla bla ....
            multiDexEnabled true
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
     buildTypes {
            release {
                minifyEnabled false
                //...
            }
        }
     compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }

    configurations.all {   //this piece is important to avoid duplicates
        exclude group: 'com.android.support',
                module: 'support-v4' 
    }

    }


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

    implementation('com.android.support:design:28.0.0') {
//        exclude group: 'com.android.support', module: 'support-annotations' 
//  enable this if still issue exists
    }
    implementation 'com.android.support:support-v4:28.0.0'
    implementation('com.android.support:appcompat-v7:28.0.0') {
//        exclude group: 'com.android.support', module: 'support-annotations'
    }
    implementation 'com.android.support:palette-v7:28.0.0'
    implementation 'com.android.support:multidex:1.0.0'
    implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation('com.squareup.retrofit2:retrofit:2.5.0') {
        // exclude Retrofit’s OkHttp dependency module and define your own module import
        exclude module: 'okhttp'
    }
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    // Dependencies for working withRepoContract Architecture components
    // You'll probably have to update the version numbers in guild.gradle (Project)
    implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
    annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
    implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion"
    annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    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'
}
apply plugin: 'com.google.gms.google-services'

Project Gradle : 项目摇篮:

buildscript {
     repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:3.2.0' // google-services plugin

        classpath 'com.android.tools.build:gradle:3.3.1'

      }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
ext {
    roomVersion = '1.1.1'
    archLifecycleVersion = '1.1.1'
}

Gradle dependency errors mainly depend on versions we use and internal duplicate libs used by the dependencies. Gradle依赖项错误主要取决于我们使用的版本以及依赖项所使用的内部重复库。 So posted things along with dependencies those worked for me. 所以发布的东西以及对我有用的依赖项。

Hope this helps for your fix. 希望这对您的修复有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase ML-Kit多功能探测器 - Firebase ML-Kit multi detectors Firebase ML-Kit 并行运行多个人脸检测会话 - Firebase ML-Kit run multiple face detection sessions in parallel ML-Kit Translation 更新翻译模型 - ML-Kit Translation Updating translation models 人脸检测器 ML-KIT 未检测到人脸 - Face Detector ML-KIT is not detecting faces 如何将要处理的图像(对象检测)发送到 firebase Ml-kit 并检索输出? - How to send image for processing (Object Detection) to firebase Ml-kit and retrieve output? 使用 ML-Kit 从收据中获取总和 - Getting the sum from receipt with ML-Kit Android Firebase ML-Kit 通过摄像头实时检测条码 - Android Firebase ML-Kit real time Barcode Detection through Camera 如何从 Android firebase ML-Kit BarcodeScannerProcessor onSuccess 找到上下文并启动新活动 - How can I find context and start a new Activity from Android firebase ML-Kit BarcodeScannerProcessor onSuccess 使用 Android Camera2 API 和 Firebase ML-Kit Vision 进行实时条码处理 - Real time barcode processing with Android Camera2 API and Firebase ML-Kit Vision "使用 SurfaceView 中的 ByteBuffer 时如何在 android ML-kit 中暂停条形码扫描" - How to pause barcode scanning in android ML-kit when using ByteBuffer from SurfaceView
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM