【问题标题】:dex is not merged for android studio. Have gone through a lot of answers. Still don't get the solutiondex 没有为 android studio 合并。经历了很多答案。仍然没有得到解决方案
【发布时间】:2023-04-03 09:46:02
【问题描述】:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.souravsaikia.chattingapp"
        minSdkVersion 23
        targetSdkVersion 26
        multiDexEnabled true

        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-storage:16.0.1'
    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'
    implementation 'com.android.support:design:26.1.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    api 'com.theartofdev.edmodo:android-image-cropper:2.5.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.firebaseui:firebase-ui-database:4.2.1'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.google.android.gms:play-services-auth:16.0.1'

}


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

这是应用级别的 gradle 文件。 这里还有项目级 gradle 的代码。

buildscript {

    repositories {
        apply plugin: 'announce'
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

很抱歉重复同样的问题。但我已经在这里完成了大部分答案。但仍然找不到适合该问题的解决方案。我已经被这个问题困了两天了。因此,我们将不胜感激。

错误日志: 错误:任务 ':app:transformDexArchiveWithExternalLibsDexMergerForDebug' 执行失败。

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: 无法合并 dex

【问题讨论】:

标签: android firebase android-gradle-plugin dependencies


【解决方案1】:

我将 compileSdkVersion 更改为 27,将 targetSdkVersion 更改为 27。appcompat、design 和 recyclerView 依赖项也更改为 27.1.1。它对我有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-18
    • 2013-04-07
    • 2014-01-10
    • 2018-09-01
    • 1970-01-01
    • 2019-06-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多