{"id":2425,"date":"2024-12-14T11:59:48","date_gmt":"2024-12-14T11:59:48","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=2425"},"modified":"2024-12-14T11:59:50","modified_gmt":"2024-12-14T11:59:50","slug":"fixing-the-failed-to-transform-fishbun-0-11-2-aar-error-in-flutter","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/fixing-the-failed-to-transform-fishbun-0-11-2-aar-error-in-flutter\/","title":{"rendered":"Fixing the &#8220;Failed to Transform FishBun-0.11.2.aar&#8221; Error in Flutter"},"content":{"rendered":"\n<p>If you\u2019ve been working with Flutter and encountered the dreaded <code>Failed to transform FishBun-0.11.2.aar<\/code> error while building your app, you\u2019re not alone. This issue typically arises when using certain outdated or conflicting dependencies, which result in Gradle failing to resolve files or transform artifacts.<\/p>\n\n\n\n<p>In this blog post, I\u2019ll walk you through the steps to identify the cause of this error and provide a straightforward solution.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/12\/image-10-1024x507.png\" alt=\"\" class=\"wp-image-2426\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/12\/image-10-1024x507.png 1024w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/12\/image-10-300x148.png 300w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/12\/image-10-768x380.png 768w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2024\/12\/image-10.png 1397w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Understanding the Error<\/strong><\/h3>\n\n\n\n<p>Here\u2019s the full error message you might see in your console:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Execution failed for task ':app:mergeDebugAssets'.\n> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.\n   > Failed to transform FishBun-0.11.2.aar (com.sangcomz:FishBun:0.11.2) to match attributes {artifactType=android-assets, org.gradle.category=library, ...}.\n     > Could not find FishBun-0.11.2.aar (com.sangcomz:FishBun:0.11.2).\n       Searched in the following locations:\n       https:&#47;&#47;jcenter.bintray.com\/com\/sangcomz\/FishBun\/0.11.2\/FishBun-0.11.2.aar\n<\/code><\/pre>\n\n\n\n<p>This issue occurs because the <code>FishBun<\/code> library and its dependencies were hosted on <strong>JCenter<\/strong>, which has been deprecated and is no longer available.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Steps to Fix the Error<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Identify the Problematic Dependency<\/strong><\/h4>\n\n\n\n<p>The core problem is the dependency <code>multi_image_picker<\/code> (or its newer version, <code>multi_image_picker2<\/code>), which internally relies on the outdated <code>FishBun<\/code> library.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Analyze Your <code>pubspec.yaml<\/code> File<\/strong><\/h4>\n\n\n\n<p>If you\u2019re using either <code>multi_image_picker<\/code> or <code>multi_image_picker2<\/code>, you\u2019ll need to comment out or remove them to eliminate this error. These packages are no longer actively maintained and can cause compatibility issues.<\/p>\n\n\n\n<p>Here\u2019s an example of a problematic <code>pubspec.yaml<\/code> configuration <strong>before the fix<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencies:\n  permission_handler: ^11.0.1\n  dropdown_search: ^5.0.6\n  multi_image_picker: ^4.8.0\n  # multi_image_picker2: ^5.0.02\n  numberpicker: ^2.0.1\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Remove or Replace the Dependency<\/strong><\/h4>\n\n\n\n<p>You can fix the issue by commenting out <code>multi_image_picker<\/code> and <code>multi_image_picker2<\/code> like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dependencies:\n  permission_handler: ^11.0.1\n  dropdown_search: ^5.0.6\n  # multi_image_picker: ^4.8.0\n  # multi_image_picker2: ^5.0.02\n  numberpicker: ^2.0.1\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4. Clean and Rebuild the Project<\/strong><\/h4>\n\n\n\n<p>After making these changes, run the following commands to clean and rebuild your project:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>flutter clean\nflutter pub get\nflutter run\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Why Does This Work?<\/strong><\/h3>\n\n\n\n<p>By removing the <code>multi_image_picker<\/code> package, you effectively remove the dependency on <code>FishBun<\/code>, which relies on JCenter. Since JCenter is deprecated, Gradle fails to locate the necessary files, leading to the build error. Commenting out or replacing the outdated package resolves the issue.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Recommended Alternatives<\/strong><\/h3>\n\n\n\n<p>If you need to use a package for selecting multiple images, consider using these actively maintained alternatives:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a>ImagePicker<\/a><\/strong>: The official Flutter plugin for picking images and videos from the gallery or camera.<\/li>\n\n\n\n<li><strong><a>FilePicker<\/a><\/strong>: A versatile plugin for picking any type of file, including images.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve been working with Flutter and encountered the dreaded Failed to transform FishBun-0.11.2.aar error while building your app, you\u2019re not alone. This issue typically arises when&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2425","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=2425"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2425\/revisions"}],"predecessor-version":[{"id":2427,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/2425\/revisions\/2427"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=2425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=2425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=2425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}