首页 > 解决方案 > 错误:程序类型已存在:com.marcohc.robotocalendar.BuildConfig

问题描述

我已经处理这个错误好几天了,并审查了所有其他相关问题。所以我想我会来寻求帮助。将发布任何必要的东西。

(应用程序)build.gradle:

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.gfitsolutions"
        minSdkVersion 16 //needs 16 instead of 15 for Auth
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    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 project(':library')
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.google.firebase:firebase-core:17.2.0'
    implementation 'com.google.firebase:firebase-firestore:21.1.1'
    implementation 'com.google.firebase:firebase-storage:19.0.1'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.media:media:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.github.marcohc:robotocalendarview:3.6.1'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'pl.pawelkleczkowski.customgauge:CustomGauge:1.0.4'
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
    testImplementation 'junit:junit:4.13-beta-3'
    androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
    implementation 'com.google.gms:google-services:4.3.2'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-beta04'
    implementation 'androidx.cardview:cardview:1.0.0'
}

我不清楚重复发生在哪里。似乎当应用程序尝试构建时,marco 日历类会生成一个与我的应用程序的 BuildConfig 类相同的“BuildConfig”类,从而导致重复错误。如果我在这方面错了,请告诉我。任何帮助是极大的赞赏。

链接是在搜索时显示重复的 BuildConfig 类的图像:

关联

标签: androidclassduplicates

解决方案


因此,经过大量测试,我找到了解决问题的方法。万一有人在处理这个问题,它不是 BuildConfig 文件,而是重复的依赖项。我的应用程序在删除任何一个时都崩溃了,但在修复我的代码后,我能够删除一个。实现 'com.github.marcohc:robotocalendarview:3.6.1' 是: :library 的一部分,因此必须删除。


推荐阅读