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.