I'm new to android studio. I downloaded Bumblebee and then followed the react-native quick start installation guide react-native installation
I will open Android studio and within the terminal run npx react-native init MyApp, cd MyApp, npx react-native start, npx react-native run-android. I get the errors:
error Failed to launch emulator. Reason: No emulators found as an output of 'emulator -list-avds'
Unable to detect AGP versions for included builds. All projects in the build should use the same AGP version. Class name for the included build object: org.gradle.composite.internal.DefaultIncludedBuild$IncludedBuildImpl_Decorated.
6 actionable tasks: 4 executed, 2 up-to-date
Note: /mnt/c/Users/RandallTaylor/Mobile/App3/node_modu
* What went wrong:
Could not determine the dependencies of task ":app:compileDebugJavaWithJavac".
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at "/mnt/c/Users/RandallTaylor/Mobile/App3/android/local.properties"
/ note local.properties exists. I attempted with the linux and windows path version as SDK manager points to the Microsoft OS where it exits. and still get this error /
I've spent two days on this reading stack overflow thread with no progress. Any advice would be appreciated.
SetUp and local system info:
Windows 10
Processor AMD Ryzen 7 PRO 5850U
wsl --status Default Distribution: Ubuntu-20.04 Default Version: 2
Windows Subsystem for Linux was last updated on 4/27/2022 WSL automatic updates are on.
Kernel version: 5.10.102.1
Android Studio Bubblebee
SDK manager -> SDK Platorms -> Android 11.0R with Android SDK Platform 30, Source for Android 30, Intel x86 Aton Sytem Image SDK Tools -> 30.0.2 installed
Environment Variables -> ANDROID_HOME C:\Users\UserName\AppData\Local\Android\Sdk
ANDROID_ROOT same as ANDROID_HOME
JAVA_HOME C\Users\UserName\Desktop
cmdline-tools\external\com\google\guava\guava30円.1-jre
1 Answer 1
Inital setup
You need to install on your Windows 10 Android Studio.
Set user variable: ANDROID_HOME=C:\Users<YOUR_USER>\AppData\Local\Android\Sdk
Add to system variable PATH:
- %ANDROID_HOME%\emulator
- %ANDROID_HOME%\platform-tools
- %ANDROID_HOME%\tools
Then go to your WSL2 and install:
sudo apt-get install unzip- get android studio Command Line Tools Only and unzip it into /home/Android
- install jdk 8 with
sudo apt-get install openjdk-8-jdk - add this to your .bashrc/.zshrc:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export ADB_SERVER_SOCKET=tcp:$WSL_HOST:5037
export ANDROID_HOME=$HOME/Android
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
- restart bash and run
sdkmanager --sdk_root=${ANDROID_HOME} "platform-tools" - run
adb version && adb.exe versioncheck if versions match
Running on emulator
- Start emulator run
emulator -avd <YOUR_AVD_NAME>- don't close terminal window! - run
adb kill-serverandadb -a -P 5037 nodaemon server start- don't close terminal window! (削除) runadb devicesand check you device port, e.g. device port is 5554. (削除ここまで)(削除) form your wsl terminal runsocat -d -d TCP-LISTEN:5554,reuseaddr,fork TCP:$(cat /etc/resolv.conf | tail -n1 | cut -d " " -f 2):5554, to install socatsudo apt-get install socat. (削除ここまで)(削除) you should be all set up now. (削除ここまで)(削除) runyarn startinside project folder and then click 'a' to run android emulator, it takes me about 4-5 minutes. (削除ここまで)
EDITED
You can skip steps 3-6 and connect to emulator by inserting expo url manually without waiting minutes.
1 Comment
Explore related questions
See similar questions with these tags.