PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value

I've spent two full days fighting this error (from aiStarter) when starting the emulator
from the web Connect, Emulator menu:

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Program Files\MIT App Inventor\from-Android-SDK]

Nowhere in the docs is ANDROID_SDK_ROOT mentioned as required, but I did define it
pointing to various directories, including C:\Program Files\MIT App Inventor\from-Android-SDK.
No difference. The error seems to come up in Flutter development, but not in App Inventor,
based on lots of searching around.

I'm on Windows 10 and have (re)installed) MIT_App_Inventor_Tools_30.265.0_win_setup64.exe a few times.
I do have a working Flutter and SDK environment, but can't see any conflicts. If I start the emulator from Flutter, App Inventor can connect to it, but I want AI2's environment to work.

Any hints?

It seems that there is an issue with the current version of aiStarter. Please wait for the fix.

Is anybody defining the ANDROID_SDK_ROOT and/or ANDROID_HOME variables on Windows to run App Inventor successfully?
That would be a start...

Try AI2Offline:

Thanks, but I'm trying to find out why this particular version does not work on my machine, neither does MIT_App_Inventor_Tools_30.263.0_win_setup64.exe.
So I'm asking again Windows users: Is anybody defining the ANDROID_SDK_ROOT and/or ANDROID_HOME variables? If things work without them, this should be documented.

Can you please point to a kit that works? Thanks.

Solved! For some reason, these variables were defined as:

SET ANDROID_HOME="C:\Program Files\MIT App Inventor\from-Android-SDK"
SET ANDROID_SDK_ROOT="C:\Program Files\MIT App Inventor\from-Android-SDK"

When used in the PATH as %ANDROID_HOME% and %ANDROID_SDK_ROOT%,
this resulted in:

... ;"C:\Program Files\MIT App Inventor\from-Android-SDK"\platform-tools;
"C:\Program Files\MIT App Inventor\from-Android-SDK"\tools;...

Watch out for those spaces and quotes... they work OK with some tools, not with others.

Can you copy and paste the full output of the emulator error? The path appears to be set correctly but this error occurs when the emulator looks for files that don't exist in the SDK root. Generally, we publish exactly what is needed to support our copy of the emulator and nothing more to keep the image as small as possible. I wonder if maybe with your Flutter setup you have its own emulator executable on the command line and that one is getting launched over the App Inventor one, causing a mismatch in the expected files.

Sorry, did not keep the logs, but just make sure that when typing SET in the command window you see (no quotes!):
ANDROID_HOME=C:\Program Files\MIT App Inventor\from-Android-SDK
ANDROID_SDK_ROOT=C:\Program Files\MIT App Inventor\from-Android-SDK
This will create correct PATH entries.

My Flutter and Android Studio IDE worked great because I avoid spaces in my folder names:

In fact, I did publish the error in my OP:

PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [C:\Program Files\MIT App Inventor\from-Android-SDK]

It makes perfect sense now, but could be more helpful, for example:

Your ANDROID_SDK_ROOT variable is not pointing to a valid AVD directory. It is currently set to:

"C:\Program Files\MIT App Inventor\from-Android-SDK"

This would have made it easier to debug for someone who'd been bitten by spaces in Windows file names for several decades...

Firstly, the error message comes from the Android emulator itself, it's not generated by App Inventor, so unfortunately we have no control over the usefulness of the message.

The second thing is that when we've tested this it has been on a clean install of Windows 7 and Windows 10 (Windows 8.x users don't represent that much of our user base), and we use it in the default configuration with the spaces in the pathname. I'm wondering if part of your system environment is leaking through. To help us out on this, it would be great to see the output of the set command in cmd.exe so we can understand how your environment is set up different from a baseline Windows installation.

I believe I explained it 3 posts ago - my SET commands used quotes, which created illegal environment variables. Neither App Inventor nor the emulator are to blame.
Once I removed the quotes, things started working.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.