简体   繁体   English

com.android.tools.r8.CompilationFailedException:编译未能完成

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类型 de.blinkt.openvpn.core.NativeUtils 定义多次:D:\Android SDK\Sdk\caches\transforms-2\files-2.1\b14b647ffafc703580d277a0bdd5f814\jetified-openvpn-aar-d8dd1f8-runtime.Z68995FCBF432492D15484/blinkt:D9 /openvpn/core/NativeUtils.class, D:\C-Browser\My Application\app\build\intermediates\javac\release\classes\de\blinkt\openvpn\core\NativeUtils.class

Build.Gradle (App):- Build.Gradle(应用程序):-

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):- Build.Gradle(主要):-

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 个回复

The issue is that the type de.blinkt.openvpn.core.NativeUtils is defined twice in the included dependencies.问题是de.blinkt.openvpn.core.NativeUtils类型在包含的依赖项中定义了两次。 R8 compilation ( minifyEnabled true ) does not allow multiple definitions of the same class. R8 编译 ( minifyEnabled true ) 不允许同一个 class 的多个定义。 You will have to analyze your dependencies to see how to avoid that.您将不得不分析您的依赖关系以了解如何避免这种情况。 The error message contains the location of the two dependencies.错误消息包含两个依赖项的位置。

2 Flutter Android 构建失败:com.android.tools.r8.CompilationFailedException:编译未能完成 - Flutter Android Build Failed : com.android.tools.r8.CompilationFailedException: Compilation failed to complete

尝试了好几天; 谷歌搜索并尝试各种“修复”和“依赖项”等,但仍然无法构建 APK 以供发布。 调试没问题。 我的命令:flutter build apk --release error: AILURE: Build failed with an exception。 什么地方出了错: 任务“ ...

5 Xamarin,CompilationFailedException:编译未能完成,来源:classes.jar:ApkLibraryInstaller$ZipFileInZipEntry.class - Xamarin, CompilationFailedException: Compilation failed to complete, origin: classes.jar : ApkLibraryInstaller$ZipFileInZipEntry.class

我正在为 Android 开发 Xamarin 项目,但构建失败 我不知道这是为什么。 这在安装Twilio.Conversations.Xamarin nuget 库后引起。 是否缺少任何配置? ...

9 在Android中将Appium集成后无法构建项目(编译无法完成) - Failed to Build Project after Appium integration in Android (Compilation failed to complete)

将Appium UI测试集成到Android项目中后,无法构建我的项目。 结合使用Linux和Appium Client 1.8.1和Android Emulator进行测试。 我能够在模拟器上运行测试。 它从一个屏幕到另一个屏幕测试我的UI代码,并且测试同样通过。 但是现在的问 ...

暂无
暂无

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

相关问题 编译失败:Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete - Compilation failed to complete:Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete Flutter Android 构建失败:com.android.tools.r8.CompilationFailedException:编译未能完成 - Flutter Android Build Failed : com.android.tools.r8.CompilationFailedException: Compilation failed to complete XAMARIN - java.lang.RuntimeException:com.android.tools.r8.CompilationFailedException:编译未能完成 - XAMARIN - java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete com.android.tools.r8.CompilationFailedException - com.android.tools.r8.CompilationFailedException Xamarin,CompilationFailedException:编译未能完成,来源:classes.jar:ApkLibraryInstaller$ZipFileInZipEntry.class - Xamarin, CompilationFailedException: Compilation failed to complete, origin: classes.jar : ApkLibraryInstaller$ZipFileInZipEntry.class 编译无法在android studio中完成 - Compilation failed to complete in android studio 编译无法完成:程序类型已经存在:com.google.android.gms.ads.identifier.AdvertisingIdClient $ zza - Compilation failed to complete : Program type already present: com.google.android.gms.ads.identifier.AdvertisingIdClient$zza 编译未能完成:程序类型已存在:com.google.android.gms.internal.measurement.zzabn - Compilation failed to complete:Program type already present: com.google.android.gms.internal.measurement.zzabn 在Android中将Appium集成后无法构建项目(编译无法完成) - Failed to Build Project after Appium integration in Android (Compilation failed to complete) 编译未能完成 - Compilation failed to complete
 
粤ICP备18138465号  © 2020-2022 STACKOOM.COM