我今天升级了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:合并dex归档文件时出错: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 \ transfor ms \ 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 \ in termediates \ 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 \ Do cuments \ 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 \ 32 8.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运行以获取完整的见解。
37秒内失败 错误完成:Gradle任务assembleDebug失败,退出代码为1
答案 0 :(得分:0)
打开{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
}
打开{your flutter project}/android/gradle.properties
并添加以下行。
...
android.useAndroidX=true // Add this line
android.enableJetifier=true //Add this line