Skip to content

[Flutter doctor] Does not show connected devices and installed IDEs on Apple Silicon M1 Pro SoC with Linux 5.17-asahi #99333

Closed

Description

@TheOneWithTheBraid

On Linux aarch64, Flutter refuses to detect the Android devices connected to the host.

Steps to Reproduce

  1. install Flutter (e.g. from dev channel)
  2. install Android SDK (in my case on Debian via package manager)
  3. adb devices
  4. flutter doctor -v and see no android devices

Running on Apple Silicon M1 Pro SoC with Linux 5.17-asahi.

Logs

Logs
 flutter doctor -vv
[  +69 ms] executing: uname -m
[  +34 ms] Exit code 0 from: uname -m
[        ] aarch64
[   +6 ms] executing: [/opt/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[  +13 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[        ] b101bfe32f634566e7cb2791a9efe19cf8828b15
[        ] executing: [/opt/flutter/] git tag --points-at
b101bfe32f634566e7cb2791a9efe19cf8828b15
[  +14 ms] Exit code 0 from: git tag --points-at
b101bfe32f634566e7cb2791a9efe19cf8828b15
[        ] 2.11.0-0.1.pre
[   +6 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +2 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [/opt/flutter/] git ls-remote --get-url origin
[   +2 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +47 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref HEAD
[   +2 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[  +31 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[  +29 ms] Artifact Instance of 'MaterialFonts' is not required, skipping
update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping
update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping
update.
[  +36 ms] executing: [/opt/flutter/] git rev-parse --abbrev-ref HEAD
[   +2 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[        ] Skipping request to fetchTags - on well known channel beta.
[        ] executing: [/opt/flutter/] git tag --points-at HEAD
[  +21 ms] Exit code 0 from: git tag --points-at HEAD
[        ] 2.11.0-0.1.pre
[   +2 ms] executing: /opt/android-studio/jre/bin/java -version
[  +53 ms] Exit code 0 from: /opt/android-studio/jre/bin/java -version
[        ] openjdk version "11.0.14" 2022-01-18
           OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1)
           OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1, mixed mode)
[   +9 ms] executing: [/opt/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%ar
[   +5 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%ar
[        ] 13 days ago
[  +37 ms] [✓] Flutter (Channel beta, 2.11.0-0.1.pre, on Debian GNU/Linux
bookworm/sid
               5.17.0-rc4-asahi-next-20220217-g501bccfe4c2d-dirty, locale
en_US.UTF-8)
[   +1 ms]     • Flutter version 2.11.0-0.1.pre at /opt/flutter
[        ]     • Upstream repository https://github.com/flutter/flutter.git
[        ]     • Framework revision b101bfe32f (13 days ago), 2022-02-16
07:36:54 -0800
[        ]     • Engine revision e355993572
[        ]     • Dart version 2.17.0 (build 2.17.0-69.2.beta)
[        ]     • DevTools version 2.10.0-dev.1
[        ] [✗] Chrome - develop for the web (Cannot find Chrome executable at
               google-chrome)
[        ]     ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome
executable.
[  +65 ms] [✓] Linux toolchain - develop for Linux desktop
[        ]     • Debian clang version 13.0.1-3
[        ]     • cmake version 3.22.1
[        ]     • ninja version 1.10.1
[        ]     • pkg-config version 0.29.2
[        ] [!] Flutter IDE Support (No supported IDEs installed)
[        ]     • IntelliJ - https://www.jetbrains.com/idea/
[        ]     • Android Studio - https://developer.android.com/studio/
[   +2 ms]     • VS Code - https://code.visualstudio.com/
[        ] [✓] Connected device (1 available)
[        ]     • Linux (desktop) • linux • linux-arm64 • Debian GNU/Linux
bookworm/sid
                 5.17.0-rc4-asahi-next-20220217-g501bccfe4c2d-dirty
[+2226 ms] [✓] HTTP Host Availability
[        ]     • All required HTTP hosts are available
[        ] ! Doctor found issues in 2 categories.
[   +5 ms] "flutter doctor" took 2,525ms.
[   +2 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 0
 file /opt/android-studio/jre
/opt/android-studio/jre: symbolic link to /usr/lib/jvm/java-11-openjdk-arm64
 echo $ANDROID_HOME
/lib/android-sdk
 echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-arm64
 uname -r
5.17.0-rc4-asahi-next-20220217-g501bccfe4c2d-dirty

Activity

  1. maheshj01 commented on Mar 1, 2022

    @maheshj01
    Member

    Hi @TheOneWithTheBraid, Thanks for filing the issue. I believe flutter tool depends on adb, if adb devices doesn't return any set of devices then it is expected to not see the devices in flutter doctor output.

    Please share the output of which adb? which should return the path where adb is located also ensure that your Android device has USB debugging enabled.

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 1, 2022
  3. TheOneWithTheBraid commented on Mar 2, 2022

    @TheOneWithTheBraid
    Author
     which adb
    /usr/bin/adb
     adb devices
    List of devices attached
    99051FFAZ006PC	device
     adb shell
    flame:/ $ exit
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 2, 2022
  5. TheOneWithTheBraid commented on Mar 2, 2022

    @TheOneWithTheBraid
    Author

    Moreover, both VS Codium and Android Studio are not detected by the flutter tool on aarch64.

  6. maheshj01 commented on Mar 2, 2022

    @maheshj01
    Member

    Thanks for the info, Looks like there is something misconfigured on your system, So even your doctor output shows errors. labeling this issue for further investigation.

    Running on Apple Silicon M1 Pro SoC with Linux 5.17-asahi.

    This is important to note that user is running Linux on a M1 mac.

    cc: @christopherfujino

  7. added
    platform-linuxBuilding on or for Linux specifically
    t: flutter doctorProblem related to the "flutter doctor" tool
    toolAffects the "flutter" command-line tool. See also t: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Mar 2, 2022
  8. changed the title [-]No connected Android devices found on Linux aarch64[/-] [+][Flutter doctor] Does not show connected devices and installed IDEs on Apple Silicon M1 Pro SoC with Linux 5.17-asah[/+] on Mar 2, 2022
  9. changed the title [-][Flutter doctor] Does not show connected devices and installed IDEs on Apple Silicon M1 Pro SoC with Linux 5.17-asah[/-] [+][Flutter doctor] Does not show connected devices and installed IDEs on Apple Silicon M1 Pro SoC with Linux 5.17-asahi[/+] on Mar 2, 2022
  10. christopherfujino commented on Mar 2, 2022

    @christopherfujino
    Contributor

    I don't believe Android Studio is supported for Linux ARM, so I wouldn't expect this to work. Per our website, "Flutter relies on a full installation of Android Studio to supply its Android platform dependencies."

    I don't think the Android SDK from the debian repos will work, regardless of architecture.

  11. TheOneWithTheBraid commented on Mar 2, 2022

    @TheOneWithTheBraid
    Author

    The manual flutter build {apk|appbundle} commands worked so far; it's not a problem of the SDK hence.

    Android Studio is based on IntelliJ's Java-based IDE. The only reason their pre-built downloads are not made for ARM is that they ship their own JRE. As stated above, linking $ANDROID_STUDIO_DIR/jre to another location (in my case /usr/lib/jvm/java-11-openjdk-arm64) or setting the STUDIO_JRE environment variable resolves this issue.

    The Flutter doctor's logs moreover show, it properly interacts with Android Studio:

    [   +2 ms] executing: /opt/android-studio/jre/bin/java -version
    [  +53 ms] Exit code 0 from: /opt/android-studio/jre/bin/java -version
    [        ] openjdk version "11.0.14" 2022-01-18
               OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1)
               OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1, mixed mode)
    

    The Android SDK installed in /lib/android-sdk is a mix of Debian's official builds and additions installed by sdkmanager. Android licenses are accepted by running flutter doctor --android-licenses which surprisingly worked even though the doctor's output didn't detect the SDK.

    This is a more or less well-documented workaround - which actually perfectly works - to get Android Studio running on aarch64 but actually unrelated to the question why it doesn't show connected Android devices.

    The main question I cannot respond to is why the doctor skips the entire Android-Studio-, -SDK-, and devices-related part.

  12. christopherfujino commented on Mar 2, 2022

    @christopherfujino
    Contributor

    The manual flutter build {apk|appbundle} commands worked so far; it's not a problem of the SDK hence.

    That's great, I'm impressed.

    This is a more or less well-documented workaround - which actually perfectly works - to get Android Studio running on aarch64 but actually unrelated to the question why it doesn't show connected Android devices.

    I was not aware this was well-documented. In that case, I suggest you follow-up with those that have documented this workflow. It is not, as of yet, officially supported by the Flutter team. I would happily review PRs however improving our support of the non-Android Studio SDK.

  13. TheOneWithTheBraid commented on Mar 2, 2022

    @TheOneWithTheBraid
    Author

    I see. I understand Flutter team does not yet know anything about this aarch64 edge case. As I'm sure I will dive deeper into this topic from times to times, you may expect one or another PR fixing this.

  14. AlbinDalbert commented on Jul 23, 2022

    @AlbinDalbert

    I seem to have this problem aswell.

    Debian aarch64 (pinebook pro)

    adb devices does find my phone.
    flutter devices does not find my phone.
    flutter doctor is only complaining about google-chrome is missing.

  15. ferhatAksoy commented on Aug 8, 2022

    @ferhatAksoy

    The manual flutter build {apk|appbundle} commands worked so far; it's not a problem of the SDK hence.

    Android Studio is based on IntelliJ's Java-based IDE. The only reason their pre-built downloads are not made for ARM is that they ship their own JRE. As stated above, linking $ANDROID_STUDIO_DIR/jre to another location (in my case /usr/lib/jvm/java-11-openjdk-arm64) or setting the STUDIO_JRE environment variable resolves this issue.

    The Flutter doctor's logs moreover show, it properly interacts with Android Studio:

    [   +2 ms] executing: /opt/android-studio/jre/bin/java -version
    [  +53 ms] Exit code 0 from: /opt/android-studio/jre/bin/java -version
    [        ] openjdk version "11.0.14" 2022-01-18
               OpenJDK Runtime Environment (build 11.0.14+9-post-Debian-1)
               OpenJDK 64-Bit Server VM (build 11.0.14+9-post-Debian-1, mixed mode)
    

    The Android SDK installed in /lib/android-sdk is a mix of Debian's official builds and additions installed by sdkmanager. Android licenses are accepted by running flutter doctor --android-licenses which surprisingly worked even though the doctor's output didn't detect the SDK.

    This is a more or less well-documented workaround - which actually perfectly works - to get Android Studio running on aarch64 but actually unrelated to the question why it doesn't show connected Android devices.

    The main question I cannot respond to is why the doctor skips the entire Android-Studio-, -SDK-, and devices-related part.

    can you explain more how you fixed the issue please. I tried but didn't work. I did create symlink to /opt/android-stuio/jre but still same result.

  16. debuggerx01 commented on Oct 14, 2022

    @debuggerx01
    Contributor

    bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled
    // Android Studio is not currently supported on Linux Arm64 Hosts.
    && _operatingSystemUtils.hostPlatform != HostPlatform.linux_arm64;

    I found this.

  17. TheOneWithTheBraid commented on Oct 14, 2022

    @TheOneWithTheBraid
    Author

    Which is completely wrong. Android Studio is Java software which is entirely platform independent. It's my daily driver on Linux aarch64.

    I will fill a correponding PR these days.

  18. debuggerx01 commented on Oct 17, 2022

    @debuggerx01
    Contributor

    Which is completely wrong. Android Studio is Java software which is entirely platform independent. It's my daily driver on Linux aarch64.

    I will fill a correponding PR these days.

    @TheOneWithTheBraid How you fix 'aapt: cannot execute binary file' error?

  19. TheOneWithTheBraid commented on Oct 17, 2022

    @TheOneWithTheBraid
    Author

    @TheOneWithTheBraid How you fix 'aapt: cannot execute binary file' error?

    Are you trying to execute x86_64 binaries on aarch64 😂? You need to use an Android SDK compiled for aarch64 as well as a JRE for aarch64. E.g. Debian ships an Android SDK for aarch64, while there's an AUR port of IntelliJ Idea CE without built-in JRE relying on your distribution's JRE. Personally, I'm using OpenJDK JRE 18 together with the stated IntelliJ AUR port and a self-compiled Android SDK.

    Unfortunately, Google itself does not seem to be willing to support Android SDK for aarch64 in their official releases - even though these years the most powerful mobile workstation processors are definitely aarch64 CPUs from Apple or Qualcomm...

  20. github-actions commented on Nov 24, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  21. locked as resolved and limited conversation to collaborators on Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-host-armBuilding on an ARM-based platformplatform-linuxBuilding on or for Linux specificallyt: flutter doctorProblem related to the "flutter doctor" tooltoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions