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

Error in Laravel:”Invalid Key Supplied”

while trying to log in to your Laravel application, don’t worry. This issue is commonly related to misconfigured or missing keys for Laravel Passport’s OAuth2 authentication system….

Error in Laravel “Davmixcool\MetaManager\MetaServiceProvider Not Found”

When working on Laravel projects, developers often encounter errors during the setup or runtime process. One such error is the “Class ‘Davmixcool\MetaManager\MetaServiceProvider’ not found”, which can occur…

Discover Rewa Effortlessly with Motoshare’s Convenient Bike and Car Rentals

Rewa, the “Land of White Tigers,” offers a unique blend of historical, cultural, and natural attractions that captivate every traveler. To make exploring this charming city more…

Discover Shimoga (Shivamogga) Effortlessly with Motoshare’s Bike and Car Rentals

Nestled in the lush greenery of Karnataka, Shimoga (Shivamogga) is a haven for nature lovers and history enthusiasts. From the roaring Jog Falls to the tranquil forests…

Explore the Spiritual Charm of Mathura with Motoshare’s New Bike and Car Rental Services

Mathura, the birthplace of Lord Krishna, is a city brimming with spirituality, vibrant culture, and historical significance. To make your journey through this sacred city seamless, Motoshare…

Explore Nizamabad Effortlessly with Motoshare’s New Bike and Car Rental Services

Nizamabad, known for its historical monuments, serene landscapes, and rich cultural heritage, is now easier to explore with Motoshare’s newly launched bike and car rental services. Whether…

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