gpt4 book ai didi

android - flutter 生成错误-合并dex存档

转载 作者:行者123 更新时间:2023-12-03 08:10:24 26 4
gpt4 key购买 nike

我今天升级了flutter( flutter 更新)和软件包(flutter软件包更新),因为我的应用无法构建。

这是我得到的输出(尝试将sdk从27更改为28并清理后)

多谢您的协助。

Launching lib\main.dart on in debug mode...

正在初始化gradle ...
解决依赖性...
Gradle任务'assembleDebug'...
****************************************************** *******
警告:如果该版本的device_info或其依赖项与AndroidX不兼容,则它将破坏您的Android构建。
有关此问题及其解决方法的更多信息,请参见h。
此警告会针对所有Android构建失败进行打印。错误的真正根本原因可能无关。
****************************************************** *******
D8:程序类型已经存在:android.support.v4.app.INotificationSideChannel $ Stub $ Proxy

失败:生成失败,发生异常。
  • 出了什么问题:
    任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败。

    com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\271.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\272.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\273.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\274.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\275.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\276.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\277.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\278.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\279.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\280.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\281.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\282.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\283.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\284.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\285.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\286.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\287.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\288.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\289.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\290.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\291.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\292.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\293.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\294.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\295.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\296.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\297.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\298.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\299.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\300.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\301.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\302.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\303.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\304.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\305.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\306.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\307.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\308.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\309.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\310.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\311.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\312.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\313.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\314.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\315.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\316.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\317.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\318.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\319.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\320.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\321.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\322.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\323.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\324.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\325.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\326.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\327.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\328.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\329.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\330.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\331.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\332.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\333.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\334.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\335.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\336.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\337.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\338.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\339.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\340.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\341.jar, C:\Users\X\Documents\Projects\git\XX\app\build\app\intermediates\transforms\dexBuilder\debug\342.jar

  • 尝试:
    使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行,以获取更多日志输出。与--scan一起运行以获取完整的见解。
  • https://help.gradle.org上获得更多帮助

  • 建立失败37秒
    错误完成:Gradle任务assembleDebug失败,退出代码为1

    最佳答案

    Original answerYuri Misyac

  • 启用multidex。

  • 打开 {your flutter project}/android/app/build.gradle并添加以下行。
    defaultConfig {
    ...

    multiDexEnabled true // Add this line
    }


    dependencies {
    ...

    implementation 'com.android.support:multidex:1.0.3' // Add this line
    }
  • 迁移到AndroidX

  • 打开 {your flutter project}/android/gradle.properties并添加以下行。
    ...  
    android.useAndroidX=true // Add this line
    android.enableJetifier=true //Add this line

    更多信息:
  • Original answer(如果仍然无法运行,请检查此项目)
  • Enable Multidex
  • Migrating to AndroidX
  • 关于android - flutter 生成错误-合并dex存档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55078510/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com