gpt4 book ai didi

android - 在 flutter 应用程序中添加 image_picker 插件后,Gradle 构建失败

转载 作者:IT王子 更新时间:2023-10-29 06:48:49 28 4
gpt4 key购买 nike

当我在不添加图像选择器作为依赖项的情况下运行应用程序时,它工作正常。但是当我添加插件并运行时,它给我 gradle build failed 错误。

Resolving dependencies...                                    5.0s
Gradle task 'assembleDebug'...
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
D8: Program type already present: android.support.v4.app.INotificationSideChannel

*********************************************************
WARNING: This version of image_picker will break your Android build if it or its dependencies aren't compatible with AndroidX.

This warning prints for all Android build failures. The real root cause of the error may be unrelated.
*********************************************************
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\142.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\118.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\94.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\124.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\88.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\136.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\157.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\103.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\163.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\151.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\127.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\100.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\166.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\139.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\97.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\115.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\160.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\169.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\106.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\154.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\148.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\112.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\172.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\133.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\109.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\91.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\121.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\130.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\145.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\27.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\52.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\18.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\43.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\19.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\51.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\60.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\36.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\34.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\42.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\28.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\50.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\33.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\37.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\2.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\9.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\25.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\45.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\32.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\38.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\39.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\44.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\57.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\26.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\8.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\31.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\30.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\56.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\13.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\14.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\21.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\49.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\7.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\12.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\15.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\55.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\58.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\6.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\20.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\46.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\11.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\59.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\24.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\29.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\54.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\16.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\41.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\5.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\10.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\3.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\17.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\23.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\47.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\40.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\53.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\35.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\4.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\48.jar, D:\fluuter_projects\motor_app_demo\build\app\intermediates\transforms\dexBuilder\debug\22.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
Gradle task 'assembleDebug'... Done 23.7s
Gradle task assembleDebug failed with exit code 1

最佳答案

由于支持 Android X...避免 AndroidX 和回滚到旧版本的简单解决方案依赖项:图片选择器:0.4.12+1

将 Flutter 应用迁移到 AndroidX将您的 Flutter 应用程序导入 Android Studio,以便 IDE 可以按照在具有完整 IDE 支持的 Android Studio 中编辑 Android 代码中的步骤解析 Android 代码。

按照迁移到 AndroidX 的说明进行操作。

https://flutter.io/docs/development/packages-and-plugins/androidx-compatibility

https://developer.android.com/jetpack/androidx/migrate

关于android - 在 flutter 应用程序中添加 image_picker 插件后,Gradle 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54741049/

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