|

|  Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android in Flutter: Causes and How to Fix

Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android in Flutter: Causes and How to Fix

February 10, 2025

Discover the causes of the 'No toolchains found for ABI' error in Flutter and learn effective solutions to fix this issue in your development environment.

What is Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android Error in Flutter

 

Description of the Error

 

  • The error message "Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android" indicates a missing or incompatible toolchain for the MIPS64 architecture within the Android NDK.
  •  

  • ABI stands for Application Binary Interface, and it defines how different components of binary programs interact on different hardware platforms. MIPS64 is one such architecture which is no longer supported by Android NDK.
  •  

  • This error occurs when a build process (like compiling a Flutter application) references the MIPS64 toolchain unintentionally or due to incorrect configuration.

 

Common Scenarios

 

  • Older versions of the Android NDK used to support MIPS and MIPS64 architectures, but support has been deprecated. So, encountering this error usually means an attempt to access outdated or obsolete NDK components.
  •  

  • This error might also pop up when the build configuration files (such as the gradle files in a Flutter project) inadvertently request these unsupported architectures.
  •  

  • Using third-party plugins or dependencies that are still configured to support these older architectures can also be a cause.

 

Understanding the Impact

 

  • This error prevents the successful compilation of a Flutter app, meaning the app won't launch in a development environment or be built for release until the issue is addressed.
  •  

  • The absence of the MIPS64 ABI means that even if you solve the error by adjusting your configurations, devices requiring this architecture cannot be directly supported. However, this is generally trivial since Android has moved away from MIPS support.

 

Example Hypothetical Scenarios Leading to the Error

 

  • Imaginary scenario where a developer has accidentally enabled old MIPS support in their Flutter project's build files:
android {
    defaultConfig {
        ndk {
            abiFilters "mips64", "armeabi-v7a", "x86" // MIPS architecture specified
        }
    }
}

 

  • Or using a third-party Flutter plugin configured to use MIPS architecture which inadvertently leads to the error during building:

 

dependencies:
  flutter:
    sdk: flutter
  some_mips_plugin: ^0.1.0 # Hypothetical and outdated plugin

 

Conclusion

 

  • Though seemingly technical, this error serves as a remainder about the importance of maintaining up-to-date software configurations, especially when dealing with cross-platform development in Flutter.
  •  

  • The retirement of certain toolchains signifies a broader industry trend towards consolidating development efforts around a smaller number of standardized architectures – primarily ARM and x86 for Android devices.

 

What Causes Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android in Flutter

 

Understanding the Cause of Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android

 

  • ABI Deprecation:  Android NDK dropped support for the MIPS and MIPS64 architectures. If your Flutter setup is invoking or expecting toolchains for MIPS64, it may be referencing deprecated architecture support which is no longer included in more recent NDK releases.
  •  

  • Incorrect NDK Version:  This error can occur if you're using an NDK version that does not include the toolchains for certain ABI configurations. Modern NDK versions have moved away from supporting MIPS architectures entirely, which means they won't have the toolchain folders for MIPS.
  •  

  • Flutter or Plugin Mismatch:  The error could stem from an incompatibility between the Flutter SDK or a particular plugin that references or expects older NDK components. The build scripts or configuration files in plugins may incorrectly rely on the MIPS toolchain due to legacy code.
  •  

  • Path or Setup Misconfiguration:  If the Flutter project is set to target a configuration using the MIPS ABI, a misconfiguration in the build scripts or environmental setup may mislead the system into looking for nonexistent toolchains. This could be due to an outdated `gradle.build` file or an environmental variable setting that hasn't been updated.
  •  

  • Project Configuration Errors:  In some cases, the Flutter project's build configuration might inadvertently be set to require MIPS support. This may occur in the `build.gradle` of your Android app, possibly dictating ABI splits that incorrectly include unsupported MIPS configurations.

 


splits {
    abi {
        enable true
        reset()
        include 'armeabi-v7a', 'x86', 'mips64'
        universalApk true
    }
}

 

  • Legacy Code or Scripts:  Older projects that haven't been updated to accommodate modern standards might still include legacy scripts or configuration files geared for past NDK releases, which presumed the existence of toolchains for MIPS architectures.

 

How to Fix Exception: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android in Flutter

 

Update Your NDK Version

 

  • Ensure you are using an updated version of Android NDK that supports modern ABI like `mips64el-linux-android` by downloading the latest version from the official Android NDK page.
  •  

  • Extract and place the NDK in your preferred location and update your environment variables to point to the new NDK path.
  •  

 

export ANDROID_NDK_HOME=path/to/your/ndk

 

Configure Local Properties

 

  • Open your Flutter project directory, locate the `local.properties` file in your Android directory, and ensure the `ndk.dir` is pointing to the correct path of your new NDK directory.
  •  

  • If `local.properties` is missing or needs content correction, update it or create the file with the appropriate path.
  •  

 

ndk.dir=path/to/your/android/ndk

 

Check Flutter NDK Configuration

 

  • Make sure your Flutter configuration is aware of the NDK location by reviewing and modifying configuration files if necessary, such as modifying or confirming NDK settings in the `app/build.gradle` file.
  •  

  • If there's configuration specific to the ABI in your Gradle build setup, ensure it's up to date and consistent with your new NDK version.
  •  

 

android {
    ndkVersion "25.0.8775105" // Ensure version matches your installed NDK
}

 

Clean and Rebuild the Flutter Project

 

  • From your terminal, navigate to the Flutter project directory and run a clean, followed by a rebuild to ensure all links and cache are refreshed with the new settings.
  •  

  • Cleans help remove old artifacts that might be no longer compatible with the new NDK configurations.
  •  

 

flutter clean
flutter build apk

 

Verify Supported ABI Configurations

 

  • Ensure that your project's build configuration specifically enables and sets the supported ABIs and confirm it doesn't include unsupported ABIs like `mips64el-linux-android` in your Gradle files.
  •  

  • Adjust `build.gradle` to correctly specify the ABIs supported by the newer NDK versions.
  •  

 

android {
    ...
    defaultConfig {
        ...
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
        }
    }
}

 

Test Alternate Builds

 

  • Consider testing different build options to isolate and confirm the issue resolution, such as switching to "flutter run" with different targets or simulators to confirm builds proceed correctly.
  •  

  • This can help to judge whether all configurations are now correctly aligned with your platform targets.
  •