简体   繁体   English

在 flutter_wechat_assets_picker 中生成 android apk 时遇到错误

[英]Facing error while generating android apk in glide flutter_wechat_assets_picker

Following the error that occurs while generating apk in flutter继flutter生成apk时出现的错误

I am using flutter_wechat_assets_picker library which uses the glide我正在使用使用 glide 的 flutter_wechat_assets_picker 库

Type com.bumptech.glide.GeneratedAppGlideModuleImpl is defined multiple times: /Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/local_image_provider/intermediates/runtime_library_classes_jar/release/classes.jar:com/bumptech/glide/GeneratedAppGlideModuleImpl.class, /Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/app/intermediates/javac/release/classes/com/bumptech/glide/GeneratedAppGlideModuleImpl.class类型 com.bumptech.glide.GeneratedAppGlideModuleImpl 被多次定义:/Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/local_image_provider/intermediates/runtime_library_classes_jar/release/classes。 jar:com/bumptech/glide/GeneratedAppGlideModuleImpl.class, /Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/app/intermediates/javac/release/classes/com /bumptech/glide/GeneratedAppGlideModuleImpl.class

FAILURE: Build failed with an exception.失败:构建失败,出现异常。

What went wrong: Execution failed for task ':app:minifyReleaseWithR8'.出了什么问题:任务 ':app:minifyReleaseWithR8' 执行失败。 com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/local_image_provider/intermediates/runtime_library_classes_jar/release/classes.jar:com/bumptech/glide/GeneratedAppGlideModuleImpl.class com.android.tools.r8.CompilationFailedException:编译未能完成,来源:/Users/akshaypatel/Documents/Wap.net/Fultter/Wap.net/vCreation/github/vCreations-Flutter/build/local_image_provider/intermediates/runtime_library_classes_jar/release/ classes.jar:com/bumptech/glide/GeneratedAppGlideModuleImpl.class

This are the steps I have followed to configure Glide in android这是我在 android 中配置 Glide 所遵循的步骤

  • implementation 'com.github.bumptech.glide:glide:4.11.0' kapt 'com.github.bumptech.glide:compiler:4.11.0'实施 'com.github.bumptech.glide:glide:4.11.0' kapt 'com.github.bumptech.glide:compiler:4.11.0'

    in app/build.gradle file在 app/build.gradle 文件中

  • apply plugin: 'kotlin-kapt' in app/build.gradle file在 app/build.gradle 文件中应用插件:'kotlin-kapt'

  • add ExampleAppGlideModule.java file in kotlin folder Current pubspec.yaml configuration在 kotlin 文件夹中添加 ExampleAppGlideModule.java 文件当前 pubspec.yaml 配置

这是我遇到的错误日志

Following steps has resolved my issue以下步骤解决了我的问题

  1. I have added (ExampleAppGlideModule) java file in kotlin folder i change it to kotlin file我在 kotlin 文件夹中添加了 (ExampleAppGlideModule) java 文件,我将其更改为 kotlin 文件
  2. I have removed local_image_provider library which is responsible for GeneratedAppGlideModuleImpl is defined multiple times while generating the apk.我已经删除了 local_image_provider 库,它负责在生成 apk 时多次定义 GeneratedAppGlideModuleImpl。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM