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

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

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

How We Fixed “sonar-scanner: command not found” and Successfully Analyzed Our Project with SonarQube

Running static code analysis with SonarQube is essential for maintaining clean, quality code. Recently, while working on our Laravel microservice project mhn-doctors-ms, we hit a common yet…

Is SonarQube Community free Edition Good for Laravel Projects?

When working on web development projects using Laravel, JavaScript, and jQuery, maintaining code quality becomes just as important as building features. That’s where tools like SonarQube come…

Laravel Throttle Middleware: How to Increase API Rate Limit Safely and for 429 Too Many Requests

If you’re working with Laravel APIs, you might have encountered this default throttle setting: This line lives in your app/Http/Kernel.php file and controls how many requests a…

Fixing MySQL Error: Incorrect Definition of mysql.column_stats Table

The Problem While working on your MySQL server, you might come across this error in your error log: This error usually shows up after an upgrade or…

Fixing Laravel Migration Error: “Unknown Collation: utf8mb4_0900_ai_ci”

While working with Laravel and MySQL, you might run into an error during migrations like this one: Why This Happens The collation utf8mb4_0900_ai_ci is introduced in MySQL…

Why Dental Surgery Is Good and Important

Dental health plays a vital role in our overall well-being, yet it’s often overlooked until problems become serious. Dental surgery is a powerful solution that not only…

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