Repository navigation
[Flutter doctor] Does not show connected devices and installed IDEs on Apple Silicon M1 Pro SoC with Linux 5.17-asahi #99333
Copy link
Copy link
Closed
Labels
platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyt: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" tooltoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
On Linux aarch64, Flutter refuses to detect the Android devices connected to the host.
Steps to Reproduce
- install Flutter (e.g. from
devchannel) - install Android SDK (in my case on Debian via package manager)
adb devicesflutter doctor -vand 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-dirtyReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
platform-host-armBuilding on an ARM-based platformBuilding on an ARM-based platformplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyt: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" tooltoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
maheshj01 commentedon Mar 1, 2022
Hi @TheOneWithTheBraid, Thanks for filing the issue. I believe flutter tool depends on adb, if
adb devicesdoesn'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.TheOneWithTheBraid commentedon Mar 2, 2022
which adb /usr/bin/adb adb devices List of devices attached 99051FFAZ006PC device adb shell flame:/ $ exit TheOneWithTheBraid commentedon Mar 2, 2022
Moreover, both VS Codium and Android Studio are not detected by the flutter tool on aarch64.
maheshj01 commentedon Mar 2, 2022
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.
This is important to note that user is running Linux on a M1 mac.
cc: @christopherfujino
[-]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[/+][-][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[/+]christopherfujino commentedon Mar 2, 2022
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.
TheOneWithTheBraid commentedon Mar 2, 2022
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/jreto another location (in my case/usr/lib/jvm/java-11-openjdk-arm64) or setting theSTUDIO_JREenvironment variable resolves this issue.The Flutter doctor's logs moreover show, it properly interacts with Android Studio:
The Android SDK installed in
/lib/android-sdkis a mix of Debian's official builds and additions installed bysdkmanager. Android licenses are accepted by runningflutter doctor --android-licenseswhich 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.
christopherfujino commentedon Mar 2, 2022
That's great, I'm impressed.
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.
TheOneWithTheBraid commentedon Mar 2, 2022
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.
AlbinDalbert commentedon Jul 23, 2022
I seem to have this problem aswell.
Debian aarch64 (pinebook pro)
adb devicesdoes find my phone.flutter devicesdoes not find my phone.flutter doctoris only complaining about google-chrome is missing.ferhatAksoy commentedon Aug 8, 2022
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.
debuggerx01 commentedon Oct 14, 2022
flutter/packages/flutter_tools/lib/src/android/android_workflow.dart
Lines 57 to 59 in 08e1729
I found this.
TheOneWithTheBraid commentedon Oct 14, 2022
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.
debuggerx01 commentedon Oct 17, 2022
@TheOneWithTheBraid How you fix 'aapt: cannot execute binary file' error?
TheOneWithTheBraid commentedon Oct 17, 2022
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...
github-actions commentedon Nov 24, 2022
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 -vand a minimal reproduction of the issue.