Flutter包使用相同的类(如何解决类冲突?)



我使用这两个包:

barcode_scan: ^0.0.3
fluttie: ^0.3.0

当我尝试运行我的应用程序时,我会得到以下错误:

D8: Program type already present: android.support.v4.app.INotificationSideChannel
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException:合并dex存档时出错:/Users/rhuka/repository/github/elearn/fluft/fluft_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/29jar,/Users/rhuka/depository/gitehub/elearn/Fluft/ffluft_lotte_signup/build/app/intermediats/transforms/dexBuilder/debug/111.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/126.jar、/Users/rhuka/reproductory/github/elearn/fflutter_lotte_signup/build/app/intermediates/transforms/dexBuilder/debug/57.jar、/Uusers/rhuka repository/github/elearn/flutter_luttie_signup/build/ap/intermediates/transforms/dexBuilder/debug/160.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/63.jar、/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/etransforms/dexBuilder/debug/56.jar、/Uusers/rhuka repository/github/elearn/flutter/fflutter_lotte_signup/build/app/intermediates/transforms/dexBuilder/debug/64.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/28jar、/Users/rhuka/reproductory/github/elearn/fflutter_lotte_signup/build/app/intermediats/debug/dexBuilder/debug/91jar、/Uusers/rhuka repository/github/elearn/flutter_flutter_lattie_signup/build/ap/intermediates/transforms/dexBuilder/debug/81jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/27.jar、/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/dexBuilder/debug/156.jar、/Uusers/rhuka repository/github/elearn/flutter/fflutter_lotte_signup/build/app/intermediats/deverse/dexBuilder/debug/59.jar,/Users/rhuka/repository/github/elearn/flatform_lottie_signup/build/app/intermediates/transforms/dexBuilder/debug/157.jar、/Users/rhuka/reproductory/github/elearn/flasform_lotte_signup/build/app/intermediates/transforms/dexBuilder/debug/141.jar、/Uusers/rhuka repository/github/elearn/Flatform_luttie_signup/build/ap/intermediates/transforms/dexBuilder/debug/65.jar,/Users/rhuka/repository/github/elearn/flatform_lottie_signup/build/app/intermediates/debug/2.jar、/Users/rhuka/reproductory/github/elearn/flaft_lottie_signup/bbuild/app/interediates/debug/58.jar、/Users/rhuka/depository/github/elearn/Flatform_lattie_signup/build/ap/intermediates/transforms/dexBuilder/debug/3.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/101.jar、/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/etransforms/dexBuilder/debug/94.jar、/Uusers/rhuka repository/github/eLearn/flutter_flutter_lettie_signup/build/app/intermediats/defaults/dexBuilder/debug/159.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/30.jar、/Users/rhuka/depository/github/elearn/flutter/fflutter_lotte_signup/build/app/intermediats/debug/dexBuilder/debug/116.jar、/Users/rhuka/reproductory/github/elearn/fflutter/fluft_lottie_signup/bbuild/app/intermediates/transforms/dexBuilder/debug/60.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/95.jar、/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/dexBuilder/debug/158.jar、/Uusers/rhuka repository/github/elearn/flutter/fflutter_lotte_signup/build/app/intermediates/transforms/dexBuilder/debug/115.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/1.jar、/Users/rhuka/depository/github/elearn/filutter_flutter_luttie_signup/build/ap/intermediates/etransforms/dexBuilder/debug/136.jar、/Users/rhuka/reproductory/github/elearn/fflutter/fluft_lottie_signup/bbuild/app/intermediates/detransforms/dexBuilder/debug/146.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/76.jar、/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/etransforms/dexBuilder/debug/92.jar、/Uusers/rhuka repository/github/eLearn/flutter_flutter_lettie_signup/build/app/intermediates/detransforms/dexBuilder/debug/131.jar,/Users/rhuka/repository/github/elearn/flutter/flutter_lottie_signup/build/app/intermediates/debug/8.6jar,/Users/rhuka/depository/github/elearn/filutter_luttie_signup/build/ap/intermediates/etransforms/dexBuilder/debug/7.1jar,/Uusers/rhuka repository/github/eLearn/flutter_flutter_lettie_signup/build/app/intermediates/detransforms/dexBuilder/debug/62.jar,/Users/rhuka/repository/github/relearn/flutter/flutter_lotti了解如何在上解决问题https://developer.android.com/studio/build/dependencies#duplicate_classes.程序类型已存在:android.support.v4.app.INotificationSideChannel

在我看来,它们都使用相同的类android.support.v4.app.INotificationSideChannel,因为当我尝试只使用其中一个时,一切都很好。但我的申请表上需要这两个。我怎样才能忽略重复的类或只是解决这个问题?

我面临着与qr_code_scanner相同的冲突,解决方案是删除或更改其中一个的类。我不知道flutter是否有内置的方法来处理这种冲突。但是你可以尝试的是从git repo中获取包。这些更改将代码推送到你自己的repo中,并从你自己的git repo:中发布

dependencies:
fluttie:
git:
url: https://github.com/...
ref: main

相关内容

  • 没有找到相关文章