Search code examples
androidfluttersigned-apk

Generate Signed APK - Error:java: invalid source release: 14


Recently I started with Flutter and made an app, now I am trying to sign the APK for the release version as documented in: https://developer.android.com/studio/publish/app-signing

I have searched a lot on the internet but I have absolutely no clue what I am doing wrong..

When I try to generate the signed APK with my Keystore I am running into an error:

  • Information:java: Errors occurred while compiling module 'vista_presentie'
  • Information:javac 1.8.0_242-release was used to compile java sources
  • Information:Module "vista_presentie" was fully rebuilt due to project configuration/dependencies changes
  • Information:28-10-2020 19:42 - Build completed with 1 error and 0 warnings in 5 s 852 ms

** Error:java: invalid source release: 14

If I need to give some more information from the code I will update this question as soon as possible, please just ask me :)

Kind Regards,

Kevin


Solution

  • It seems you're using Java 1.8 to compile but in your android studio project you may have set the java language level to 14.

    In Android Studio, go to Project Structure -> Modules -> Properties and set Source Compatibility and Target Compatibility to 1.8 (Java 8)