Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

react native - AVD Manager: unable to locate adb in android studio

I'm just starting out my react track and thought of a little react-native app. Well, I installed Android Studio, the SDK and all that I needed according to https://reactnative.dev/docs/environment-setup, using the react-native CLI tab. But when I try to launch my emulator for any device on my list I get the error: AVD manager unable to locate adb. I have checked my %ANDROID_HOME% variable and it's set to the correct Sdk dir, I can use adb.exe inside the platform-tools dir with no apparent problem. But the AVD manager can't.

I even tried reinstalling Android SDK after deleting the platform-tools dir, or even installing a different version of it, but it just won't work!

Any thoughts on what is happening?

question from:https://stackoverflow.com/questions/65869166/avd-manager-unable-to-locate-adb-in-android-studio

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I struggled with this problem for a few days now and the number 1 suggestion I found is:

  1. review your environment variables (such as %ANDROID_HOME%);
  2. remove the platform-tools dir inside %ANDROID_HOME%, adb.exe is either corrupted or missing;
  3. reinstall Android SDK and check for adb.exe inside %ANDROID_HOME%platform-tools;
  4. emulate a new device (you are a wizard Harry!);

Well, this didn't work for me but apparently worked for some people, especially for avast users (apparently it corrupts adb.exe 'cause it believes it to be malware).

What worked for me was:

  1. In Android Studio go to File > Project Structure (Ctrl + Alt + Shift + S in windows);
  2. Under Project Settings>Project>Project SDK must have a valid Android SDK selected;
  3. emulate a new device (you are a wizard SadSack963!);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...