Open miquelbeltran opened 1 month ago
If you are facing a compilation error similar to this:
* What went wrong: Execution failed for task ':package_info_plus:compileDebugJavaWithJavac'. > error: invalid source release: 17
flutter upgrade
flutter pub upgrade
flutter clean
You can find them in the packages README.md.
README.md
For example:
Check that your project is using Java 17.
Run flutter doctor -v and find the Android section, for example:
flutter doctor -v
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /home/xyz/Android/Sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /home/xyz/Android/Sdk • Java binary at: /snap/android-studio/155/jbr/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160) • All Android licenses accepted.
To ensure that you are using the right OpenJDK Java version, install the latest version of Android Studio, and perform a flutter clean.
[!NOTE] If compilation errors persist after following this guide, please search on Stack Overflow or Google before creating a new issue ticket.
If all the above fails, then create a compilation error ticket using this template: Compile Error Template
I will leave this ticket open and pinned for visibility. Any opened issues regarding this can me marked as duplicated and linked to this.
If you are facing a compilation error similar to this:
1. Upgrade and clean project
flutter upgrade
flutter pub upgrade
flutter clean
2. Check project requirements
You can find them in the packages
README.md
.For example:
Check that your project is using Java 17.
Run
flutter doctor -v
and find the Android section, for example:3. Upgrade Android Studio
To ensure that you are using the right OpenJDK Java version, install the latest version of Android Studio, and perform a
flutter clean
.4. If nothing else works:
If all the above fails, then create a compilation error ticket using this template: Compile Error Template