question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin doesn't respect local ANDROID_HOME exports

See original GitHub issue

Flutter Android Studio extension doesn’t seem to respect exports from my shell. I’m using zsh (oh-my-zsh) on Manjaro linux.

When I execute flutter doctor from Android Studio I get this:

/run/media/storage/flutter/bin/flutter --no-color doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.8, on Linux, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✓] Android Studio (version 3.1)

! Doctor found issues in 2 categories.
Process finished with exit code 0

But on the console I get this

[✓] Flutter (Channel beta, v0.2.8, on Linux, locale en_US.UTF-8)
    • Flutter version 0.2.8 at /run/media/storage/flutter
    • Framework revision b397406561 (11 days ago), 2018-04-02 13:53:20 -0700
    • Engine revision c903c217a1
    • Dart version 2.0.0-dev.43.0.flutter-52afcba357

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.2)
    • Android SDK at /run/media/storage/android-sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-26, build-tools 26.0.2
    • ANDROID_HOME = /run/media/storage/android-sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.1)
    • Android Studio at /opt/android-studio
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (1 available)
    • SM G925K • 03157df3db30c710 • android-arm64 • Android 5.1.1 (API 22)

Resetting Android Studio doesn’t help.

How can I at least work around this to add ANDROID_HOME properly to flutter plugin?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
binary132commented, Jun 20, 2018

@damienix, perhaps the way you launched Android Studio didn’t inherit the variables set in your shell’s rc file. If you launch it from a shell session, do you get the expected behavior?

2reactions
damienixcommented, Jun 20, 2018

Bingo, that helps 😃 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Failed to find 'ANDROID_HOME' environment variable
Try setting setting it manually. Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK...
Read more >
Throwing error ANDROID_HOME is not set - Appium Discuss
Open the terminal and type : export ANDROID_HOME=/Applications/ADT/sdk. Add this to the PATH environment variable. export PATH=$PATH:$ANDROID_HOME ...
Read more >
neither android_home nor android_sdk_root environment ...
Appium on window, start session on Android Studio Emulator, error message Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported.
Read more >
Android Platform Guide - Apache Cordova
Android Platform Guide. This guide shows how to set up your SDK environment to deploy Cordova apps for Android devices, and how to...
Read more >
AGP looks for ANDROID_SDK_ROOT, not ANDROID_HOME ...
We should make sure the error message instead reflects that the issue is a non-existent directory, and ideally list the variable it used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found