expo-cli
expo-cli copied to clipboard
ANDROID_HOME on linux
Summary
I`m running an project with expo on linux (Zorin OS). When i try to run the app the expo is saying "Failed to resolve the Android SDK path. Default install location not found: /home/enrico/Android/sdk. Use ANDROID_HOME to set the Android SDK location."
The problems and fix
- Android home
- Problem: Failed to resolve the Android SDK path. Default install location not found: ~/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
- Solution: The default ANDROID_HOME in linux is $HOME/Android/Sdk and the platform tools is PATH=$PATH:$ANDROID_HOME/platform-tools
Environment
expo-env-info 1.0.5 environment info:
System:
OS: Linux 5.15 Zorin OS 16.1
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.15.1 - ~/.asdf/installs/nodejs/16.15.1/bin/node
Yarn: 1.22.19 - ~/.asdf/installs/nodejs/16.15.1/.npm/bin/yarn
npm: 8.18.0 - ~/work/MBPharma/node_modules/.bin/npm
npmPackages:
@expo/webpack-config: ^0.17.0 => 0.17.2
expo: ~46.0.7 => 46.0.8
react: 18.0.0 => 18.0.0
react-dom: 18.0.0 => 18.0.0
react-native: 0.69.5 => 0.69.5
react-native-web: ~0.18.7 => 0.18.7
npmGlobalPackages:
eas-cli: 1.2.0
expo-cli: 6.0.5
Expo Workflow: managed
Please specify your device/emulator/simulator platform, model and version
PIXEL_2 emulator SDK 30
Error output
No response
Reproducible demo or steps to reproduce from a blank project
Run an project in linux using expo with
yarn start
then if successfully runs start android studio and start an android emulator like pixel.
Then if all runs fine press a
to open in Android emulator
I'm also seeing this when running from within Docker on Windows. Not having this problem on Docker on macOS.
Having a very similar issue:
when running the client with npx expo start
everything works as expected.
when running the client with tunnel support I get an error message:
npx expo start --tunnel
Starting project at /SOME/PATH
Starting Metro Bundler
Failed to resolve the Android SDK path. Default install location not found: /home/NAME/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
Failed to resolve the Android SDK path. Default install location not found: /home/NAME/Android/sdk. Use ANDROID_HOME to set the Android SDK location.
Error: spawn adb ENOENT
Error: spawn adb ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21)"
My environment:
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
npm list
source@ /SOME/PATH
├── @expo/[email protected]
├── [email protected]
.....
any solution ?
diable your firewall
sudo ufw disable
The same here!
Please expo team, is this issues getting fixed ? It's slowing down a lot of process
I have the same issue as @Chr1k0 Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye @Rajat-Raghuvanshi-0512 ufw is not a command in my environment. Any other ideas how to fix this?
This issue started for me when we upgraded from Expo 44 to 46. For me the solution was that the folder was named "Sdk" with a capital "S" but the error message said the folder with a lowercase "s" didn't exist. So I changed the name to "sdk" instead of "Sdk" and it worked.
Had the same issue: ANDROID_HOME is set to a non-existing path
I had to set the environment variables by adding the correct path (Linux Mint) edit the .bashrc file using nano or gedit or whatever it is you use and add the following paths to that file
export ANDROID_HOME=${HOME}/Android/Sdk export PATH=${ANDROID_HOME}/tools:${PATH} export PATH=${ANDROID_HOME}/emulator:${PATH} export PATH=${ANDROID_HOME}/platform-tools:${PATH}
then
source .bashrc
worked for me
Wow brushan, can't believe that was the problem. that helped me, thanks.
Same happening here on OSX.
I have the issue, but I try had fixed. That is my solution Follow this step first: https://stackoverflow.com/questions/38577669/run-react-native-on-android-emulator And then config Add the following lines to your $HOME/.bash_profile or $HOME/.bashrc (if you are using zsh then ~/.zprofile or ~/.zshrc) config file:
export ANDROID_SDK_ROOT=$HOME/Library/Android/Sdk export PATH=$PATH:$ANDROID_SDK_ROOT/emulator export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
Reload bash or zsh editor Reset
It works for me.
Two things:
-
In versioned Expo CLI we no longer ship a vendored copy of adb, users are required to install and configure Android support for their computer. The vendored copy had a lot of issues since
expo-cli
shipped a copy for every supported OS ofexpo-cli
. This also caused a ton of bloat on devices since every project would have multiple copies ofadb
. -
I landed a fix for the versioned CLI requiring
adb
for tunnel connections: https://github.com/expo/expo/pull/19593. You can now use all platform agnostic features of the versioned CLI without having to install any Android-specific libraries.