9

All of a sudden the Android Studio emulator has stopped working. When I attempt to run a virtual device, I get the following error in the Event Log.

Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT Emulator: Process finished with exit code 1

So I checked to see what value the ANDROID_SDK_ROOT environment variable was set to, and it was empty. So I set it to /Users/{username}/Library/Android/sdk based on an answer to a similar question; but I still get the same error.

I tried deleting all of the virtual devices from the AVD Manager and creating a new one (as suggested here), but no luck. I also tried uninstalling and reinstalling all of the SDK component packages; I still get the same error.

I cannot figure out what happened, or how to fix it. Could the ANDROID_SDK_ROOT value I set be incorrect? (The value I set is the same as my ANDROID_HOME variable, which does point to the directory that contains the Android SDK).

The only thing I can think of that I haven't tried yet is to uninstall and reinstall Android Studio (I would rather try to avoid that if I can).


Update

Well... I deleted everything I could find relating to Android Studio.

~/.android
~/.AndroidStudio*
~/Applications/Android \Studio.app
~/Library/Android
~/Library/Application \Support/AndroidStudio*
~/Library/Caches/AndroidStudio*
~/Library/Logs/AndroidStudio*
~/Library/Preferences/AndroidStudio*
~/Library/Preferences/com.android.Emulator.plist
~/Library/Preferences/com.google.android.*

Then did a fresh install of Android Studio... and I'm still getting the same error. Did I miss something? What is causing this issue??

Community
  • 1
  • 1
Bryan
  • 14,756
  • 10
  • 70
  • 125

1 Answers1

4

I had been messing around with CodeWorks for Android in order to get a working version of Unreal Engine that supports ARCore. I never did get Unreal+ARCore to work, but the emulator in Android Studio had been working fine so I didn't think anything of it.

I noticed that whenever I ran the emulator the ANDROID_HOME and ANDROID_SDK_ROOT would get reset to /Users/{username}/Library/NVPACK/sdk/ and blank respectively. I removed the NVPACK library, and set both ANDROID_HOME and ANDROID_SDK_ROOT to /Users/{username}/Library/Android/sdk/ and now the emulator works as expected again.


Update

I ended up going back to messing with Unreal Engine, and realizing I still needed CodeWorks installed to be able to launch an Android application from Unreal.

So I figured out that Android Studio was getting screwed up because ANDROID_HOME was set to /Users/{username}/Library/NVPACK/sdk/ but in the SDK Manager the SDK location was still set to /Users/{username}/Library/Android/sdk/. I changed this value to /Users/{username}/Library/NVPACK/sdk/ and after re-installing the SDK files, the emulator was up and running fine.

Community
  • 1
  • 1
Bryan
  • 14,756
  • 10
  • 70
  • 125