Skip to content
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

Tool can't parse version of Android Studio Preview on macOS #121925

Open
2 tasks done
ti4n1993 opened this issue Mar 4, 2023 · 19 comments
Open
2 tasks done

Tool can't parse version of Android Studio Preview on macOS #121925

ti4n1993 opened this issue Mar 4, 2023 · 19 comments
Labels
found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically t: flutter doctor Problem related to the "flutter doctor" tool team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team

Comments

@ti4n1993
Copy link

ti4n1993 commented Mar 4, 2023

Is there an existing issue for this?

Steps to reproduce

Using the Android Studio Giraffe Canary 7 and the latest master channel flutter

Actual results

Flutter doctor is still saying unable to find bundled java

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.9.0-1.0.pre.48, on macOS 13.3 22E7752300f
    darwin-arm64, locale en-US)
    • Flutter version 3.9.0-1.0.pre.48 on channel master at /Users/ti4n/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f2f80059ff (23 minutes ago), 2023-03-03 23:39:38 -0500
    • Engine revision de724e2632
    • Dart version 3.0.0 (build 3.0.0-290.0.dev)
    • DevTools version 2.22.2

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.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 find bundled Java version.
    • Try updating or re-installing Android Studio.
@exaby73 exaby73 added the in triage Presently being triaged by the triage team label Mar 6, 2023
@exaby73
Copy link
Member

exaby73 commented Mar 6, 2023

Hello @ti4n1993. This may be because you're using a preview version of Android Studio. Can you confirm if it's working as expected on the stable Eel version?

@exaby73 exaby73 added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 6, 2023
@ti4n1993
Copy link
Author

ti4n1993 commented Mar 6, 2023

@exaby73 I have tested on Electric Eel, it works as expect. Is there any plan to support canary version of Android Studio

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 6, 2023
@exaby73
Copy link
Member

exaby73 commented Mar 6, 2023

@ti4n1993 I cannot be certain right now. Since this is a relatively new version, and the teams efforts are currently on features announced in Flutter Forward, it's hard to say. Keep in mind, that this may also be an issue with Android Studio itself since it is a canary version :)

I'll try to reproduce this tomorrow as it will take some time for me to install the new version and make sure my config is correct. If I do reproduce it, I'll label this issue so that the team can look at it ad provide some insights I may not have

@exaby73
Copy link
Member

exaby73 commented Mar 7, 2023

Hello @ti4n1993. Seems I cannot reproduce this issue.

[✓] Android Studio (version 2022.3)
    • Android Studio at /home/exabyt3/programs/android-studio-preview
    • 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.6+0-17.0.6b802.4-9586694)

@exaby73 exaby73 added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 7, 2023
@gnprice
Copy link
Member

gnprice commented Mar 7, 2023

I think this is a variation on #121468. In the original log, the tool is failing to identify the version of Android Studio:

[!] Android Studio
    • Android Studio at /Applications/Android Studio Preview.app/Contents

If it had identified the version, it would print the version, as it did in the log at #121925 (comment) :

[✓] Android Studio (version 2022.3)

(That should probably be made more explicit in the output — it's pretty subtle, and the information would be helpful in debugging. → Filed #122081.)

Then once it does fail to identify the Android Studio version, it treats the Android Studio install as if it were of an ancient version, in the same way as in #121468. That defeats the fix for #106674, causing the symptom seen here.

So the new question in this issue is why the tool can't identify the Android Studio version. Based on the code at AndroidStudio.fromMacOSBundle, I think the next step for debugging is: @ti4n1993, would you post here the output of the following command?
cat "/Applications/Android Studio Preview.app/Contents/Info.plist"

@ti4n1993
Copy link
Author

ti4n1993 commented Mar 8, 2023

@gnprice

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDocumentTypes</key>
    <array>
      <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
          <string>ipr</string>
        </array>
        <key>CFBundleTypeIconFile</key>
        <string>studio.icns</string>
        <key>CFBundleTypeName</key>
        <string>Android Studio Project File</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
      </dict>
      <dict>
        <key>CFBundleTypeExtensions</key>
        <array>
          <string>*</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>All documents</string>
        <key>CFBundleTypeOSTypes</key>
        <array>
          <string>****</string>
        </array>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSTypeIsPackage</key>
        <false/>
      </dict>
    </array>
    <key>CFBundleExecutable</key>
    <string>studio</string>
    <key>CFBundleIconFile</key>
    <string>studio.icns</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>Android Studio</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleIdentifier</key>
    <string>com.google.android.studio-EAP</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleGetInfoString</key>
    <string>Android Studio EAP AI-223.8617.56.2231.9644228, build AI-223.8617.56.2231.9644228. Copyright JetBrains s.r.o., (c) 2000-2023</string>
    <key>CFBundleShortVersionString</key>
    <string>EAP AI-223.8617.56.2231.9644228</string>
    <key>CFBundleVersion</key>
    <string>AI-223.8617.56.2231.9644228</string>

      <key>CFBundleURLTypes</key>
      <array>
        <dict>
          <key>CFBundleTypeRole</key>
          <string>Editor</string>
          <key>CFBundleURLName</key>
          <string>Stacktrace</string>
          <key>CFBundleURLSchemes</key>
          <array>
                      <string>idea</string>
          </array>
        </dict>
      </array>


    <key>LSApplicationCategoryType</key>
    <string>public.app-category.developer-tools</string>
    <key>LSArchitecturePriority</key>
    <array>
      <string>arm64</string>

      <string>x86_64</string>
    </array>
    <key>LSRequiresNativeExecution</key>
    <string>YES</string>
    <key>LSMinimumSystemVersion</key>
    <string>10.8</string>

    <key>NSHighResolutionCapable</key>
    <true/>
    <key>NSSupportsAutomaticGraphicsSwitching</key>
    <true/>

    <key>JVMOptions</key>
    <dict>
      <key>ClassPath</key>
      <string>$APP_PACKAGE/Contents/lib/util.jar:$APP_PACKAGE/Contents/lib/app.jar:$APP_PACKAGE/Contents/lib/3rd-party-rt.jar:$APP_PACKAGE/Contents/lib/platform-statistics-devkit.jar:$APP_PACKAGE/Contents/lib/jps-model.jar:$APP_PACKAGE/Contents/lib/stats.jar:$APP_PACKAGE/Contents/lib/protobuf.jar:$APP_PACKAGE/Contents/lib/external-system-rt.jar:$APP_PACKAGE/Contents/lib/forms_rt.jar:$APP_PACKAGE/Contents/lib/intellij-test-discovery.jar:$APP_PACKAGE/Contents/lib/annotations.jar:$APP_PACKAGE/Contents/lib/groovy.jar:$APP_PACKAGE/Contents/lib/3rd-party-native.jar:$APP_PACKAGE/Contents/lib/annotations-java5.jar:$APP_PACKAGE/Contents/lib/byte-buddy-agent.jar:$APP_PACKAGE/Contents/lib/error-prone-annotations.jar:$APP_PACKAGE/Contents/lib/externalProcess-rt.jar:$APP_PACKAGE/Contents/lib/idea_rt.jar:$APP_PACKAGE/Contents/lib/intellij-coverage-agent-1.0.682.jar:$APP_PACKAGE/Contents/lib/junit.jar:$APP_PACKAGE/Contents/lib/junit4.jar:$APP_PACKAGE/Contents/lib/platform-objectSerializer-annotations.jar:$APP_PACKAGE/Contents/lib/rd.jar:$APP_PACKAGE/Contents/lib/resources.jar:$APP_PACKAGE/Contents/lib/util_rt.jar:$APP_PACKAGE/Contents/lib/ant/lib/ant.jar</string>
      <key>JVMVersion</key>
      <string>1.8*,1.8+</string>
      <key>MainClass</key>
      <string>com/intellij/idea/Main</string>
      <key>Options</key>
      <array>
        <string>-XX:FlightRecorderOptions=stackdepth=256</string>
        <string>--add-opens=java.base/java.io=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.lang=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.lang.ref=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.lang.reflect=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.net=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.nio=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.nio.charset=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.text=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.time=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.util=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.util.concurrent=ALL-UNNAMED</string>
        <string>--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED</string>
        <string>--add-opens=java.base/jdk.internal.vm=ALL-UNNAMED</string>
        <string>--add-opens=java.base/sun.nio.ch=ALL-UNNAMED</string>
        <string>--add-opens=java.base/sun.nio.fs=ALL-UNNAMED</string>
        <string>--add-opens=java.base/sun.security.ssl=ALL-UNNAMED</string>
        <string>--add-opens=java.base/sun.security.util=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/com.apple.eawt=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/com.apple.eawt.event=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/com.apple.laf=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt.dnd.peer=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt.event=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt.image=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt.peer=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/java.awt.font=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/javax.swing=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.awt.datatransfer=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.awt.image=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.awt=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.font=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.java2d=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.lwawt=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED</string>
        <string>--add-opens=java.desktop/sun.swing=ALL-UNNAMED</string>
        <string>--add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED</string>
        <string>--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</string>
        <string>--add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED</string>
        <string>--add-opens=jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED</string>
      </array>
      <key>Properties</key>
      <dict>
        <key>java.system.class.loader</key>
        <string>com.intellij.util.lang.PathClassLoader</string>
        <key>idea.vendor.name</key>
        <string>Google</string>
        <key>idea.paths.selector</key>
        <string>AndroidStudioPreview2022.3</string>
        <key>jna.boot.library.path</key>
        <string>$APP_PACKAGE/Contents/lib/jna/aarch64</string>
        <key>pty4j.preferred.native.folder</key>
        <string>$APP_PACKAGE/Contents/lib/pty4j</string>
        <key>jna.nosys</key>
        <string>true</string>
        <key>jna.noclasspath</key>
        <string>true</string>
        <key>idea.platform.prefix</key>
        <string>AndroidStudio</string>
        <key>splash</key>
        <string>true</string>
        <key>idea.executable</key>
        <string>studio</string>
        <key>idea.home.path</key>
        <string>$APP_PACKAGE/Contents</string>
      </dict>
    </dict>

    <key>NSCameraUsageDescription</key>
    <string>An application in Android Studio requests access to the device's camera.</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>An application in Android Studio requests access to the device's microphone.</string>
    <key>NSLocationUsageDescription</key>
    <string>An application in Android Studio requests access to the user's location information.</string>
    <key>NSDesktopFolderUsageDescription</key>
    <string>An application in Android Studio requests access to the user's Desktop folder.</string>
    <key>NSDocumentsFolderUsageDescription</key>
    <string>An application in Android Studio requests access to the user's Documents folder.</string>
    <key>NSDownloadsFolderUsageDescription</key>
    <string>An application in Android Studio requests access to the user's Downloads folder.</string>
    <key>NSNetworkVolumesUsageDescription</key>
    <string>An application in Android Studio requests access to files on a network volume.</string>
    <key>NSRemovableVolumesUsageDescription</key>
    <string>An application in Android Studio requests access to files on a removable volume.</string>
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>An application in Android Studio requests access to Bluetooth.</string>
    <key>NSAppleEventsUsageDescription</key>
    <string>An application in Android Studio requests the ability to send Apple events.</string>
  </dict>
</plist>

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Mar 8, 2023
@gnprice
Copy link
Member

gnprice commented Mar 8, 2023

Great, that explains it:

    <key>CFBundleShortVersionString</key>
    <string>EAP AI-223.8617.56.2231.9644228</string>

We try to match that version string EAP AI-223.8617.56.2231.9644228 against the following pattern:

  static final RegExp versionPattern =
      RegExp(r'^(\d+)(\.(\d+)(\.(\d+))?)?');

which indeed doesn't match.

For comparison, here's what it looks like on the Android Studio install I have lying around on a Mac:

$ grep -A1 CFBundleShortV /Applications/Android\ Studio.app/Contents/Info.plist 
    <key>CFBundleShortVersionString</key>
    <string>2021.3</string>

So that's the sort of string that the pattern was written for.

@gnprice gnprice changed the title Flutter doctor is still saying unable to find bundled java Tool can't parse version of Android Studio 2022.3 Giraffe on macOS Mar 8, 2023
@gnprice gnprice added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. and removed in triage Presently being triaged by the triage team labels Mar 8, 2023
@gnprice
Copy link
Member

gnprice commented Mar 8, 2023

I don't see anything in that Info.plist file that directly contains the version number 2022.3 that we're looking for. Potentially the right answer here is going to be to start looking at the CFBundleVersion instead, because that has the same format in the file @ti4n1993 posted:

    <key>CFBundleVersion</key>
    <string>AI-223.8617.56.2231.9644228</string>

as it does on the Dolphin install I have lying around:

    <key>CFBundleVersion</key>
    <string>AI-213.7172.25.2113.9123335</string>

so there's some hope it might be stable.

In that version string, the part after "AI-" seems to encode the major and minor version: "AI-YYN.*" means Android Studio 20YY.N. That pattern has held since the introduction of the "Android Studio 20YY.N" version numbers a couple of years ago:
https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html#2020

Alternatively, we could stop looking for a version in the format 20YY.N and try to take the AI-223.etc.etc. string directly, if that's the form Android Studio wants to describe its version in. That would probably require some more refactoring, though.

@exaby73 exaby73 added t: flutter doctor Problem related to the "flutter doctor" tool has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 labels Mar 8, 2023
@camsim99
Copy link
Contributor

camsim99 commented Mar 9, 2023

Will let the tools team set the priority for this @christopherfujino

@reidbaker
Copy link
Contributor

Issue filed against the Android Studio team since the value we are seeing is an illegalValue according to apple.
https://b.corp.google.com/issues/276489469

https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleshortversionstring "This key is a user-visible string for the version of the bundle. The required format is three period-separated integers, such as 10.14.1. The string can only contain numeric characters (0-9) and periods."

@reidbaker
Copy link
Contributor

Android studio rejected the bug against them. Here are the onboarding docs I think I will have to write a unit test for them https://g3doc.corp.google.com/company/teams/android-studio/development/index.md?cl=head.

FWIW this value was also broken on the flamingo version until canary.

@reidbaker
Copy link
Contributor

reidbaker commented Apr 18, 2023

folders to look in tools/adt/idea/studio/integration/ which mostly relates to "does this application start with the expected plugins list"
possibly tools/adt/idea/studio/tools_test.py is a place to start or maybe
tools/adt/idea/studio/tests/test_studio.py

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-android Owned by Android platform team triaged-android Triaged by Android platform team labels Jul 8, 2023
@andrewkolos andrewkolos changed the title Tool can't parse version of Android Studio 2022.3 Giraffe on macOS Tool can't parse version of Android Studio Preview on macOS Oct 4, 2023
@navaronbracke
Copy link
Contributor

@andrewkolos I ran flutter doctor -v on Windows with Hedgehog Beta 6, and it ran fine:

Android Studio Hedgehog | 2023.1.1 Beta 6
Build #AI-231.9392.1.2311.10844163, built on September 21, 2023

[√] Flutter (Channel stable, 3.13.6, on Microsoft Windows [Version 10.0.19045.3448], locale nl-BE)
    • Flutter version 3.13.6 on channel stable at E:\Documenten\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ead455963c (8 days ago), 2023-09-26 18:28:17 -0700
    • Engine revision a794cf2681
    • Dart version 3.1.3
    • DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at E:\Android\Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = E:\Android\Sdk
    • Java binary at: E:\Documenten\android-studio-hedgehog\android-studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2023.1)
    • Android Studio at E:\Documenten\android-studio-hedgehog\android-studio
    • 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.7+0-b2043.56-10550314)

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.3448]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 103.0.5060.134
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 116.0.1938.81

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@paoloose
Copy link

paoloose commented Oct 25, 2023

Hey, hope you're doing well. Any updates on this? I'm facing this issue on Debian 12

$ flutter doctor -v

[✓] Flutter (Channel stable, 3.13.8, on Debian GNU/Linux trixie/sid 6.5.0-2-amd64, locale en_US.UTF-8)
    • Flutter version 3.13.8 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6c4930c4ac (6 days ago), 2023-10-18 10:57:55 -0500
    • Engine revision 767d8c75e8
    • Dart version 3.1.4
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /opt/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 16.0.6 (17)
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (version unknown)
    • Android Studio at /opt/android-studio
    • 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 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.83.1)
    • VS Code at /usr/share/code
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Debian GNU/Linux trixie/sid 6.5.0-2-amd64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 118.0.5993.88

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

I've tried with the following versions:

  • Electric Eel | 2022.1.1
  • Flamingo | 2022.2.1 Patch 2
  • Giraffe | 2022.3.1
  • Giraffe | 2022.3.1 Patch 1
  • Giraffe | 2022.3.1 Patch 2 (latest)

But I'm still getting the same error.

@andrewkolos
Copy link
Contributor

I've tried with the following versions:

  • Electric Eel | 2022.1.1
  • Flamingo | 2022.2.1 Patch 2
  • Giraffe | 2022.3.1
  • Giraffe | 2022.3.1 Patch 1
  • Giraffe | 2022.3.1 Patch 2 (latest)

@paoloose, this issue should only affect you if you are running a Preview version of Android Studio. If you are encountering this on release (non-Preview) versions, please file a new issue and tag me. I would be happy to assist.

@jockeF
Copy link

jockeF commented Dec 19, 2023

This "✗ Unable to determine Android Studio version." is preventing work on Android Studio Hedgehog | 2023.1.1 Build #AI-231.9392.1.2311.11076708, built on November 9, 2023 on Kubuntu 22.04. Claims to be the very latest version. I had a fully working environment, agreed to update and am now stuck. Not a great experience, makes you wonder if Android Studio and Flutter is such a great tool after all. Especially since I have had similar sudden trouble before with flutter, and this bug seems to go back a long time. Some thread was closed because "works on windows". Well, who develops on windows in 2023? Ridiculous. This breaking after update certainly does makes you think of windows.

@christopherfujino
Copy link
Member

christopherfujino commented Dec 19, 2023

This "✗ Unable to determine Android Studio version." is preventing work on Android Studio Hedgehog | 2023.1.1 Build #AI-231.9392.1.2311.11076708

@jockeF This should not be blocking you from doing any actual flutter development. If you know you have Android Studio installed, you can feel free to ignore the diagnostic.

If the red x really bothers you, we would welcome a pull request to fix it :)

@jpSimkins
Copy link

Same issue with Ubuntu 24.04 LTS and install Android Studio from apt.

Adroid Studio version: Build #AI-232.10300.40.2321.11668458, built on April 3, 2024

flutter doctor -v
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.19.6, on Ubuntu 24.04 LTS 6.8.0-31-generic, locale en_US.UTF-8)
    • Flutter version 3.19.6 on channel stable at /home/jpsimkins/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (11 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/jpsimkins/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /opt/android-studio-2023.2.1/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2023.2)
    • Android Studio at /opt/android-studio-2023.2.1/android-studio
    • Flutter plugin version 79.0.1
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[!] Android Studio (version unknown)
    • Android Studio at /opt/android-studio
    • 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 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.88.1)
    • VS Code at /snap/code/current/usr/share/code
    • Flutter extension version 3.86.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 24.04 LTS 6.8.0-31-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.91

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

@Muhammad-Abubakr
Copy link

This issue can also be seen with Android Studio Jellyfish on elementary OS 7.1 Horus. Android Studio has been installed as a Flatpak and configured with Flutter using the following

flutter config --android-studio-dir=/var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio

but the output of flutter doctor still shows being unable to determine android studio version

[✓] Flutter (Channel stable, 3.19.6, on elementary OS 7.1 Horus 6.5.0-28-generic, locale
    en_US.UTF-8)
    • Flutter version 3.19.6 on channel stable at /home/frosty/pkgs/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (2 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/frosty/Android/Sdk
    • Platform android-34-2, build-tools 34.0.0
    • Java binary at:
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio/jbr/bi
      n/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /var/lib/flatpak/exports/bin/com.google.Chrome

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[!] Android Studio (version unknown)
    • Android Studio at
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
    • 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.
    • android-studio-dir =
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.88.0)
    • VS Code at /var/lib/flatpak/app/com.visualstudio.code/x86_64/stable/active/files/extra/vscode
    • Flutter extension version 3.88.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • elementary OS 7.1 Horus 6.5.0-28-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 124.0.6367.118

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
found in release: 3.7 Found to occur in 3.7 found in release: 3.9 Found to occur in 3.9 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-android Android applications specifically t: flutter doctor Problem related to the "flutter doctor" tool team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests