Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig

I got this error when building my android project:

“Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig found in modules …”

This started to happen after SDKBOX 2.7.1 (the version 2.7.1 works fine, but any other version after this will make this error).

I even don’t have AdColony plugin in my project!

Any ideas how to fix this? Thanks.

you must be using some sdkbox plugins?

can you post any screenshots of your environment?

I’m using these plugins (I tried with and without AdColony because I thought if I remove AdColony the issue will be solved, but unfortunately not):

AdMob
Chartboost
UnityAds
Misc
Review
Facebook
Firebase
IAP
SdkboxAds
SdkboxPlay

The full error is:

Duplicate class com.chartboost.sdk.CBImpressionActivity found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.CBLocation found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Chartboost found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Chartboost$CBFramework found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Chartboost$CBMediation found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.ChartboostDelegate found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.InPlay.CBInPlay found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.CBLogging found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.CBLogging$Level found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.CBUtility found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.b found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.c found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.d found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.d$a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.e found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.e$a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.f found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.g found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.h found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.h$a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.i found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Libraries.j found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.CBError found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.CBError$CBClickError found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.CBError$CBImpressionError found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.CBError$a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.b found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.c found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.d found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Model.e found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Tracking.CBAnalytics found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Tracking.CBAnalytics$CBIAPPurchaseInfo found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Tracking.CBAnalytics$CBIAPType found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Tracking.CBAnalytics$CBLevelType found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.Tracking.a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.b found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.c found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.d found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.e found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.e$a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.f found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.g found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.h found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.i found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.a found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.b found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.c found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.d found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.e found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.f found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.g found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.h found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.i found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.j found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.k found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.l found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.m found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.n found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.o found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.p found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.q found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.r found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.s found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.t found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.u found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.v found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.w found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.x found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.y found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.chartboost.sdk.impl.z found in modules classes.jar (com.chartboost:chartboost-sdk:8.1.0) and jetified-chartboost.jar (chartboost.jar)
Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig found in modules PluginChartboost.jar (PluginChartboost.jar) and PluginIAP.jar (PluginIAP.jar)

My project’s build.gradle:

apply plugin: ‘com.android.application’

android {
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
buildToolsVersion PROP_BUILD_TOOLS_VERSION

defaultConfig {
    applicationId "com.rapidturtlegames.stripes"
    minSdkVersion PROP_MIN_SDK_VERSION
    targetSdkVersion PROP_TARGET_SDK_VERSION
    versionCode 1
    versionName "1.0"

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}



    externalNativeBuild {
        if (PROP_BUILD_TYPE == 'ndk-build') {
            ndkBuild {
                targets 'MyGame'
                arguments 'NDK_TOOLCHAIN_VERSION=clang'
                arguments '-j' + Runtime.runtime.availableProcessors()
            }
        }
        else if (PROP_BUILD_TYPE == 'cmake') {
            cmake {
                targets 'MyGame'
                arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", \
                          "-DUSE_CHIPMUNK=TRUE", "-DUSE_BULLET=TRUE"
                cppFlags "-frtti -fexceptions"
                // prebuilt root must be defined as a directory which you have right to access or create if you use prebuilt
                // set "-DGEN_COCOS_PREBUILT=ON" and "-DUSE_COCOS_PREBUILT=OFF" to generate prebuilt,  this way build cocos2d-x libs
                // set "-DGEN_COCOS_PREBUILT=OFF" and "-DUSE_COCOS_PREBUILT=ON" to use prebuilt, this way not build cocos2d-x libs
                //arguments "-DCOCOS_PREBUILT_ROOT=/Users/laptop/cocos-prebuilt"
                //arguments "-DGEN_COCOS_PREBUILT=OFF", "-DUSE_COCOS_PREBUILT=OFF"
            }
        }
    }

    ndk {
        abiFilters = []
        abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
    }
}

sourceSets.main {
    java.srcDir "src"
    res.srcDir "res"
    manifest.srcFile "AndroidManifest.xml"
    assets.srcDir "../../Resources"
}

externalNativeBuild {
    if (PROP_BUILD_TYPE == 'ndk-build') {
        ndkBuild {
            path "jni/Android.mk"
        }
    }
    else if (PROP_BUILD_TYPE == 'cmake') {
        cmake {
            path "../../CMakeLists.txt"
        }
    }
}

signingConfigs {

   release {
        if (project.hasProperty("RELEASE_STORE_FILE")) {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
        }
    }
}

buildTypes {
    release {
        debuggable false
        jniDebuggable false
        renderscriptDebuggable false
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        if (project.hasProperty("RELEASE_STORE_FILE")) {
            signingConfig signingConfigs.release
        }

        externalNativeBuild {
            ndkBuild {
                arguments 'NDK_DEBUG=0'
            }
        }
    }

    debug {
        debuggable true
        jniDebuggable true
        renderscriptDebuggable true
        externalNativeBuild {
            ndkBuild {
                arguments 'NDK_DEBUG=1'
            }
        }
    }
}

flavorDimensions "version"
productFlavors {
    /*huawei {
        dimension "version"
        applicationIdSuffix ".huawei"
        manifestPlaceholders = [facebookContentProvider:"com.facebook.app.FacebookContentProvider4069939133045174Huawei"]

        versionNameSuffix "-huawei"
        versionCode 1
        versionName "1.0"
    }*/
    google {
        dimension "version"
        manifestPlaceholders = [facebookContentProvider:"com.facebook.app.FacebookContentProvider4069939133045174"]

        versionCode 2
        versionName "1.0"
    }
}

dexOptions {
    javaMaxHeapSize "4G"
}
lintOptions {
    disable 'MissingTranslation'
}

}

android.applicationVariants.all { variant →
// delete previous files first
delete “${buildDir}/intermediates/assets/${variant.dirName}”

variant.mergeAssets.doLast {
    copy {
        from "${buildDir}/../../../Resources"
        into "${buildDir}/intermediates/assets/${variant.dirName}"
        exclude "**/*.gz"
    }
}

}

dependencies {
implementation fileTree(dir: ‘libs’, include: [’*.jar’])
implementation project(’:libcocos2dx’)

implementation 'com.tappx.sdk.android:tappx-sdk:3.+'
implementation 'com.revenuecat.purchases:purchases:3.1.1'
implementation 'com.gameanalytics.sdk:gameanalytics-android:+'

}
dependencies { implementation ‘com.google.android.gms:play-services-ads:18.3.0’ }
dependencies { implementation ‘com.facebook.android:facebook-android-sdk:5.+’ }
dependencies { implementation ‘com.google.firebase:firebase-analytics:17.4.4’ }
dependencies { implementation ‘com.google.android.gms:play-services-base:16.1.0’ }
dependencies { implementation ‘com.android.billingclient:billing:3.0.2’ }
dependencies { implementation ‘com.android.support:support-compat:28.0.0’ }
dependencies { implementation project(’:libPluginReviewResource’) }
dependencies { implementation ‘com.google.android.gms:play-services-auth:17.0.0’ }
dependencies { implementation ‘com.google.android.gms:play-services-games:19.0.0’ }
dependencies { implementation ‘com.google.android.gms:play-services-drive:17.0.0’ }
dependencies { implementation ‘com.google.android.gms:play-services-ads-identifier:17.0.0’ }
dependencies { implementation ‘com.chartboost:chartboost-sdk:8.1.0’ }

Ok. Thank you.

@htlxyz

the reason maybe your project have two chartboost sdk, you can remove app/libs/chartboost.jar and just use gradle way to use chartboost.

Now I’m getting only: Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig

adcoloney should be the same reason with chartboost.

If there’s no Chartboost plugin imported, then the following error occurs:

Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig found in modules PluginAdColony.jar (PluginAdColony.jar) and PluginIAP.jar (PluginIAP.jar).

I’m trying this with a fresh project and the latest SDKBOX v2.7.5 versions.

Can this be related to the Gradle versions, minimum android version etc.?

PluginIAP.jar shouldn’t contain com.sdkbox.plugin.adcoloney.BuildConfig.

can you remove ~/.sdkbox/plugins and then re-import the plugins?

If there are also still, Duplicate class com.sdkbox.plugin.adcoloney.BuildConfig, can you share your project or a detailed steps that can reproduce

Here’s the link to a test project with the sdkbox plugins imported:

pls run

zip -d ./PluginIAP.jar com/sdkbox/plugin/adcoloney/BuildConfig.class

under path proj.android/app/libs,

and we will check this issue.

When I run that command, the project builds successfully!