英文:
how to remove unused plugin in pubspec.lock
问题
例如,我刚刚从webview_flutter更改为flutter_webview_pro。
当我尝试运行flutter build apk --split-per-abi时,出现以下错误:
在执行com.android.build.gradle.internal.tasks.Workers$ActionFacade时发生故障
com.android.builder.dexing.DexArchiveMergerException: 合并dex存档时出错:
了解如何解决此问题,请访问https://developer.android.com/studio/build/dependencies#duplicate_classes。
类型io.flutter.plugins.webviewflutter.BuildConfig在多处定义:/Users/mypc/ccc/myapps/build/webview_pro_android/.transforms/bdbf64f9d3abc9a772a513f41adb1eaa/classes/classes.dex,/Users/mypc/ccc/myapps/build/webview_flutter_android/.transforms/11582e4deb0c75876ac071bae0201050/classes/classes.de
之后,我检查了pubspec.lock、.flutter-plugins和.flutter-plugins-dependencies,之前的包'webview_flutter'仍然存在。
我尝试创建新项目,但在更改这些包时没有遇到相同的问题,pubspec.lock正常生成。
英文:
for example, i just change from webview_flutter to flutter_webview_pro.
and when i try flutter build apk --split-per-abi, this error comes out :
failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
> Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
> Type io.flutter.plugins.webviewflutter.BuildConfig is defined multiple times: /Users/mypc/ccc/myapps/build/webview_pro_android/.transforms/bdbf64f9d3abc9a772a513f41adb1eaa/classes/classes.dex, /Users/mypc/ccc/myapps/build/webview_flutter_android/.transforms/11582e4deb0c75876ac071bae0201050/classes/classes.de
after that i check pubspec.lock, .flutter-plugins and .flutter-plugins-dependencies, the previous packages 'webview_flutter' still remaining
i try creating new project but i don't have the same issues while change those packages, the pubspec.lock generate normally
答案1
得分: 1
删除 pubspec.lock
文件。
然后运行 flutter clean
。
然后运行 flutter pub get
。
在运行上述命令之后,pubspec.lock
文件将自动生成。
英文:
Delete pubspec.lock
file.
then run flutter clean
.
then run flutter pub get
after run above command pubspec.lock
file ganerate automatically.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论