I found the error is caused by the Android Gradle Plugin (AGP) version in the Flutter app, as defined in android/settings.gradle: plugins { ...... id "com.android.application" version "8.1.0" apply false ...... } The version "8.1.0" requires Java 17 to build, changing it to "7.3.0" will work with Java 8.