Q: React Native Android error on trying to run staging build through terminal error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
The operation couldn't be completed. Unable to locate a Java Runtime.
error Command failed with exit code 1.

I already added
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

in my zsh config. The emulator successfully opens but then i get that error when the app tries to open on the emulator. Anyone know how to get this working?

A: I had the same issue with my new macbook pro with M1 and I solve it installing SDKMAN to manage different Java versions and then the AdoptOpenJDK 11.0.11.hs-adpt
Install SDKMAN:
$ curl -s "https://get.sdkman.io" | bash

Install Java version:
$ sdk install java 11.0.11.hs-adpt 

See this article https://wiredverse.com/2021/05/running-java-jdk-natively-on-apple-m1-macs-apple-silicon/
