Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOps School!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Fixing the “Failed to Transform FishBun-0.11.2.aar” Error in Flutter

If you’ve been working with Flutter and encountered the dreaded Failed to transform FishBun-0.11.2.aar error while building your app, you’re not alone. This issue typically arises when using certain outdated or conflicting dependencies, which result in Gradle failing to resolve files or transform artifacts.

In this blog post, I’ll walk you through the steps to identify the cause of this error and provide a straightforward solution.


Understanding the Error

Here’s the full error message you might see in your console:

Execution failed for task ':app:mergeDebugAssets'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform FishBun-0.11.2.aar (com.sangcomz:FishBun:0.11.2) to match attributes {artifactType=android-assets, org.gradle.category=library, ...}.
     > Could not find FishBun-0.11.2.aar (com.sangcomz:FishBun:0.11.2).
       Searched in the following locations:
       https://jcenter.bintray.com/com/sangcomz/FishBun/0.11.2/FishBun-0.11.2.aar

This issue occurs because the FishBun library and its dependencies were hosted on JCenter, which has been deprecated and is no longer available.


Steps to Fix the Error

1. Identify the Problematic Dependency

The core problem is the dependency multi_image_picker (or its newer version, multi_image_picker2), which internally relies on the outdated FishBun library.

2. Analyze Your pubspec.yaml File

If you’re using either multi_image_picker or multi_image_picker2, you’ll need to comment out or remove them to eliminate this error. These packages are no longer actively maintained and can cause compatibility issues.

Here’s an example of a problematic pubspec.yaml configuration before the fix:

dependencies:
  permission_handler: ^11.0.1
  dropdown_search: ^5.0.6
  multi_image_picker: ^4.8.0
  # multi_image_picker2: ^5.0.02
  numberpicker: ^2.0.1

3. Remove or Replace the Dependency

You can fix the issue by commenting out multi_image_picker and multi_image_picker2 like this:

dependencies:
  permission_handler: ^11.0.1
  dropdown_search: ^5.0.6
  # multi_image_picker: ^4.8.0
  # multi_image_picker2: ^5.0.02
  numberpicker: ^2.0.1

4. Clean and Rebuild the Project

After making these changes, run the following commands to clean and rebuild your project:

flutter clean
flutter pub get
flutter run

Why Does This Work?

By removing the multi_image_picker package, you effectively remove the dependency on FishBun, 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.


Recommended Alternatives

If you need to use a package for selecting multiple images, consider using these actively maintained alternatives:

  • ImagePicker: The official Flutter plugin for picking images and videos from the gallery or camera.
  • FilePicker: A versatile plugin for picking any type of file, including images.

Related Posts

Exploring and Creating a Proof of Concept (POC) to Upload APK Directly from GitHub Package

Automating the process of uploading an APK (or AAB) to the Google Play Store from GitHub can significantly speed up your CI/CD pipeline. By integrating Google Play’s…

A Detailed Guide to CI/CD with GitHub Actions

Continuous Integration (CI) and Continuous Deployment (CD) are modern software development practices that automate the process of integrating code changes, running tests, and deploying applications. With the…

Step-by-Step Guide for Setting Up Internal Testing in Google Play Console

1. Understanding the Types of Testing Before uploading your Android app for internal testing, it’s essential to know the differences between the testing options available in Google…

The Complete 2025 Guide to GitLab Training, Certification, and Expert Trainers

Level Up Your DevOps Career: The Complete 2025 Guide to GitLab Training, Certification, and Expert Trainers Introduction to GitLab: The Backbone of Modern DevOps As businesses accelerate…

Site Reliability Engineering (SRE) Foundation Certification

Introduction to Site Reliability Engineering (SRE) Foundation Certification The Site Reliability Engineering (SRE) Foundation certification is an industry-recognized credential designed to provide students with a comprehensive understanding…

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x