Open Sameri11 opened 1 month ago
Closing this as a duplicate of https://github.com/flutter/flutter/issues/121925
@danagbemava-nc hi and thanks for your attention! Can you please elaborate, in which way this duplicates flutter/flutter#121925 ? From what I can see, in flutter/flutter#121925 bug is related to Android Studio version itself, not plugin versions, isn't it? As you can see in my actual output, Android Studio version determined correctly (and it's not even Preview
version).
@Sameri11 My apologies, this is what I saw in the doctor output that led me to the other issue
[!] Android Studio (version unknown)
• Android Studio at /Users/samer/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to determine Android Studio version.
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
I do see a similar output from my flutter doctor -v although I just installed in the plugins. For IntelliJ, the plugins are read properly on my system.
I think modern Android Studio changed path where plugins contained an Application Support
, in this code: https://github.com/flutter/flutter/blob/c4c9f47c479da3786bb5d42e127597d6508fab50/packages/flutter_tools/lib/src/android/android_studio.dart#L75-L84
In this code,presetPluginsPath
will be resolved to /Users/user/Library/Application Support/Google/AndroidStudio2024.1
in my environment, but plugins are in plugins
dir inside this path. So, maybe it would be enough to add plugins
here to path.
Another case is with Preview
versions of studio – it doesn't have idea.paths.selector
in Info.plist
needed here, so fallback to this code:
https://github.com/flutter/flutter/blob/c4c9f47c479da3786bb5d42e127597d6508fab50/packages/flutter_tools/lib/src/android/android_studio.dart#L185-L195
I guess this code also needs plugins
to be added to path, but also here should be possible to lookup not only AndroidStudio$major.$minor
dir, but also AndroidStudioPreview$major.$minor
– preview versions have this path format now.
UPD: also, as @danagbemava-nc said that plugins in IntelliJ displayed correctly, intellij_validator
has plugins
in it's path: https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/intellij/intellij_validator.dart#L559
Steps to reproduce
Flutter
and/orDart
plugins installed in Android Studioflutter doctor -v
Tested on these versions of Android Studio:
2024.1.2
2024.2.1
(preview)2024.2.2
(preview)Expected results
I expect output of
flutter doctor -v
to show version of Dart and Flutter plugins installed in Android Studio. Expected output:Actual results
doctor
can not determine versions ofDart
andFlutter
plugins. Actual output :Code sample
Code sample
```dart Not applicable ```Screenshots or Video
Screenshots / Video demonstration
Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel master, 3.26.0-1.0.pre.130, on macOS 14.6.1 23G93 darwin-arm64, locale en-RU) • Flutter version 3.26.0-1.0.pre.130 on channel master at /Users/samer/projects/flutter • Upstream repository git@github.com:flutter/flutter.git • Framework revision 93c8d00963 (5 hours ago), 2024-09-16 03:44:24 -0400 • Engine revision af4fe97fa1 • Dart version 3.6.0 (build 3.6.0-255.0.dev) • DevTools version 2.40.0-dev.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/samer/Library/Android/sdk • Platform android-35, build-tools 34.0.0 • Java binary at: /Users/samer/.sdkman/candidates/java/22.0.2-tem/bin/java • Java version OpenJDK Runtime Environment Temurin-22.0.2+9 (build 22.0.2+9) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode-15.4.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Users/samer/Applications/Android Studio Koala Feature Drop 2024.1.2.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314) [!] Android Studio (version unknown) • Android Studio at /Users/samer/Applications/Android Studio Ladybug Feature Drop 2024.2.2 Canary 2.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart ✗ Unable to determine Android Studio version. • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11) [!] Android Studio (version unknown) • Android Studio at /Users/samer/Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart ✗ Unable to determine Android Studio version. • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11) [✓] IntelliJ IDEA Ultimate Edition (version EAP IU-243.12818.47) • IntelliJ at /Users/samer/Applications/IntelliJ IDEA Ultimate.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.93.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.96.0 [✓] Connected device (5 available) • Михаил Новосельцев’s iPad (mobile) • 00008110-000A50AE11B9801E • ios • iOS 17.6.1 21G93 • iPhone (Михаил) (mobile) • 00008020-001254DA1E39002E • ios • iOS 17.6.1 21G93 • macOS (desktop) • macos • darwin-arm64 • macOS 14.6.1 23G93 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.6.1 23G93 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 128.0.6613.120 [✓] Network resources • All expected network resources are available. ! Doctor found issues in 2 categories. ```