You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java version is often is kind of JAVA_VERSION="17.0.3" in the release file. So, the regex can't detect the string "17.0.0" or "17.0.3", it tries to find exactly the number without any splitter (e.g. "." - dot).
But even though, if it parses the version correctly, there is another issue. After detecting that the java version is "21", it can't build the android project, because of these lines
whenever the version of Java is greater than "17", because Android doesn't support the higher version (I tried java version "21").
I got this case on old version of photo-manager library, when I installed the latest Android Studio "2024.2.2" that embeds Java 21. It happens because when we run flutter run command, it overrides JAVA_HOME env variable with a java version embedded in the latest Android Studio installed on the local machine, and if the Android Studio isn't detected, than it fallbacks to JAVA_HOME system env.
AI Summary: The build.gradle file incorrectly parses JAVA_VERSION due to regex issues and sets compileOptions to an unsupported Java version, causing build failures. The user suggests removing the explicit compileOptions setting.
Hello guys. I found that it might be incorrect parsing of the JAVA_VERSION in the build.gradle, see
flutter_photo_manager/android/build.gradle
Line 42 in f25f8b8
Java version is often is kind of
JAVA_VERSION="17.0.3"
in therelease
file. So, the regex can't detect the string "17.0.0" or "17.0.3", it tries to find exactly the number without any splitter (e.g. "." - dot).But even though, if it parses the version correctly, there is another issue. After detecting that the java version is "21", it can't build the android project, because of these lines
flutter_photo_manager/android/build.gradle
Lines 131 to 135 in f25f8b8
whenever the version of Java is greater than "17", because Android doesn't support the higher version (I tried java version "21").
I got this case on old version of photo-manager library, when I installed the latest Android Studio "2024.2.2" that embeds Java 21. It happens because when we run
flutter run
command, it overrides JAVA_HOME env variable with a java version embedded in the latest Android Studio installed on the local machine, and if the Android Studio isn't detected, than it fallbacks to JAVA_HOME system env.As a result of this issue:
I think that the library shouldn't explicitly set
compileOptions
.What do you think?
The text was updated successfully, but these errors were encountered: