简体   繁体   中英

com.android.tools.r8.CompilationFailedException: Compilation failed to complete

提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供   中文简体   中文繁体   中英对照 版本,有任何建议请联系yoyou2525@163.com。

Im getting this error while trying to make release bundle for play console:-

Type de.blinkt.openvpn.core.NativeUtils is defined multiple times: D:\Android SDK\Sdk\caches\transforms-2\files-2.1\b14b647ffafc703580d277a0bdd5f814\jetified-openvpn-aar-d8dd1f8-runtime.jar:de/blinkt/openvpn/core/NativeUtils.class, D:\C-Browser\My Application\app\build\intermediates\javac\release\classes\de\blinkt\openvpn\core\NativeUtils.class

Build.Gradle (App):-

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply from: 'https://gist.githubusercontent.com/IlyaEremin/8821fbf0069e8e60dfeaeefc19afaca2/raw/ce54be4ea6f19b9609f303cd75714d6ec8d916e5/app_version.gradle'

android {
    compileSdkVersion androidversion
    useLibrary 'org.apache.http.legacy'
    buildToolsVersion "30.0.3"
    ndkVersion '21.4.7075529'

    defaultConfig {
        applicationId "com.C.Browser"
        minSdkVersion minsupportsdkversion
        targetSdkVersion androidversion
        versionCode 28
        versionName "3.7"
        multiDexEnabled true
        resConfigs "en", "hi", "ur", "fr", "es", "in", "pt", "ru", "ms", "tr"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    packagingOptions {
        pickFirst '**/*.so'
    }

    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.3.1'
    def billing_version = "4.0.0"
    implementation "com.android.billingclient:billing:$billing_version"
    implementation 'com.github.barteksc:android-pdf-viewer:3.2.0-beta.1'
    implementation 'com.github.franmontiel:AttributionPresenter:1.0.1'
    implementation 'io.github.tonnyl:whatsnew:0.1.1'
    implementation 'com.jaredrummler:cyanea:1.0.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    implementation 'com.android.volley:volley:1.2.1'
    implementation 'com.jsibbold:zoomage:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation files('libs/achartengine-1.2.0.jar')
    //noinspection GradleDynamicVersion
    implementation 'junit:junit-dep:4.8.2'
    testImplementation 'junit:junit:4.12'
    implementation project(path: ':android-file-chooser')
    implementation project(path: ':doubletapplayerview')
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.wang.avi:library:2.1.3'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'androidx.webkit:webkit:1.4.0'
    implementation 'com.google.firebase:firebase-database:20.0.3'
    implementation platform('com.google.firebase:firebase-bom:26.6.0')
    implementation 'com.amitshekhar.android:android-networking:1.0.2'
    implementation 'com.daimajia.numberprogressbar:library:1.2@aar'

    //noinspection GradleDependency
    implementation 'com.google.android.gms:play-services-ads:19.7.0'

    implementation 'com.github.bumptech.glide:glide:4.12.0'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'com.karumi:dexter:6.2.2'
    implementation "androidx.recyclerview:recyclerview:1.2.1"
    // For control over item selection of both touch and mouse driven selection
    implementation "androidx.recyclerview:recyclerview-selection:1.2.0-alpha01"
    implementation "androidx.cardview:cardview:1.0.0"

    implementation 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    implementation 'com.intuit.sdp:sdp-android:1.0.6'

    implementation 'com.anjlab.android.iab.v3:library:1.0.44'
    implementation platform('com.google.firebase:firebase-bom:26.4.0')
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.github.anastr:speedviewlib:1.5.5'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10"
    implementation 'com.hanks:passcodeview:0.1.2'
    implementation 'com.github.GoodieBag:Pinview:v1.4'
    implementation group: 'commons-io', name: 'commons-io', version: '2.6'

    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    implementation 'com.github.clans:fab:1.6.4'

    implementation 'com.github.AnchorFreePartner.hydra-sdk-android:sdk-core:4.0.0'
    implementation 'com.github.AnchorFreePartner.hydra-sdk-android:sdk:4.0.0'
    implementation 'com.github.AnchorFreePartner.hydra-sdk-android:openvpn:4.0.0'
    implementation 'pl.bclogic:pulsator4droid:1.0.3'
    implementation 'com.pixplicity.easyprefs:library:1.9.0'

    def exoplayerVersion = '2.16.0'
    implementation("com.google.android.exoplayer:exoplayer-common:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-extractor"
    }
    implementation("com.google.android.exoplayer:exoplayer-datasource:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-common"
    }
    implementation("com.google.android.exoplayer:exoplayer-decoder:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-common"
    }
    implementation("com.google.android.exoplayer:exoplayer-database:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-common"
    }
    implementation("com.google.android.exoplayer:extension-mediasession:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-common"
    }
    implementation("com.google.android.exoplayer:exoplayer-dash:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-core"
    }
    implementation("com.google.android.exoplayer:exoplayer-hls:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-core"
    }
    implementation("com.google.android.exoplayer:exoplayer-smoothstreaming:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-core"
    }
    implementation("com.google.android.exoplayer:exoplayer-rtsp:$exoplayerVersion") {
        exclude group: "com.google.android.exoplayer", module: "exoplayer-core"
    }
    implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayerVersion"
    implementation "com.google.android.exoplayer:exoplayer-core:$exoplayerVersion"
    implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.3'
    implementation 'com.ibm.icu:icu4j:70.1'
    implementation 'com.arthenica:ffmpeg-kit-min:4.5.LTS'
    implementation 'androidx.preference:preference-ktx:1.1.1'
    implementation 'com.squareup.okhttp3:okhttp:4.9.2'
    implementation 'com.github.pepperonas:materialdialog:0.3.4'
    implementation 'pl.bclogic:pulsator4droid:1.0.3'
    implementation 'net.igenius:customcheckbox:1.3'
    implementation 'com.github.GrenderG:Toasty:1.5.0'
    implementation files('libs/achartengine-1.2.0.jar')

//    implementation fileTree(dir: "libs", include: ["extension-*.aar"])
//    implementation fileTree(dir: "libs", include: ["library-*.aar"])
}

Build.Gradle (Main):-

buildscript {

    ext {
        androidversion = 30
        minsupportsdkversion = 21
    }

    repositories {
        google()
        //noinspection JcenterRepositoryObsolete
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }

    dependencies {
        classpath "com.android.tools.build:gradle:4.0.2"
        classpath 'com.google.gms:google-services:4.3.13'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

Any solutions will be helpfull.

1 anwsers

The issue is that the type de.blinkt.openvpn.core.NativeUtils is defined twice in the included dependencies. R8 compilation ( minifyEnabled true ) does not allow multiple definitions of the same class. You will have to analyze your dependencies to see how to avoid that. The error message contains the location of the two dependencies.

暂无
暂无

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM