Trying to remove a warning when building an APK

When trying to build my project with flutter build apk, I got this message:

Your project is configured with Android NDK 26.3.11579264, but the following plugin(s) depend on a different Android NDK version:
- path_provider_android requires Android NDK 27.0.12077973
Fix this issue by using the highest Android NDK version (they are backward compatible).
Add the following to <PROJECT_DIR>/android/app/build.gradle.kts:

    android {
        ndkVersion = "27.0.12077973"
        ...
    }

But that file currently says

    ndkVersion = flutter.ndkVersion

So I thought it would make more sense to update a property file instead of directly updating the build.gradle.kts: However, creating <PROJECT_DIR>/android/app/gradle.properties and adding the line flutter.ndkVersion=27.0.12077973 to it has no effect. Adding that line to <PROJECT_DIR>/android/gradle.properties has no effect either, and adding it to <PROJECT_DIR>/android/app/local.properties also has no effect. Does anyone know how to set the NDK version using a properties file?

2 Likes