warning: [options] source value 7 is obsolete and will be removed in a future release

  1. You can set your JAVA_HOME to an older version of Java and then run your Flutter build. You would also need to have this JAVA_HOME available anywhere you build from (command line, IDE, CI/CD, etc)
  2. Update your allprojects section of android/build.gradle to look like the following:
allprojects {
  repositories {
    google()
    mavenCentral()
  }

  tasks.withType(JavaCompile).configureEach {
    javaCompiler = javaToolchains.compilerFor {
      languageVersion = JavaLanguageVersion.of(8)
    }
  }
}