-
Notifications
You must be signed in to change notification settings - Fork 26.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default to the newer version path when checking Android Studio Java path #101862
Default to the newer version path when checking Android Studio Java path #101862
Conversation
…ath. Preview versions of Android Studio has a non-standard version number like `EAP AI-203.7717.56.2031.7557721`, which fails the current version parsing. And it defaults to the older path to look for the Java binary. This commit switches to use the new path by default if the version string can't be parsed.
@@ -445,9 +445,9 @@ class AndroidStudio implements Comparable<AndroidStudio> { | |||
} | |||
|
|||
final String javaPath = globals.platform.isMacOS ? | |||
version != null && version.major >= 2020 ? | |||
globals.fs.path.join(directory, 'jre', 'Contents', 'Home') : | |||
version != null && version.major < 2020 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this change effectively flipping the default when version == null
from jre/jdk/Contents/Home
to /jre/Contents/Home
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, that's what the description says, lol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…droid Studio, assume the version to be the latest (#125247) Fixes #125246 by restoring the intended behavior of #101862. That is, when searching for a JDK and we encounter an Android Studio version we don't recognize, assume it to be the latest version `flutter` is aware of. Also does some light refactoring in the tests, like using test objects instead of referencing `globals`.
Preview versions of Android Studio has a non-standard version number
like
EAP AI-203.7717.56.2031.7557721
, which fails the current versionparsing. And it defaults to the older path to look for the Java binary.
This commit switches to use the new path by default if the version
string can't be parsed.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.