Ionic run android builds successful but gives error at the end


#1

Everything was working fine but from afternoon today, I am getting the following error:

PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT

Anyone has any idea what can cause this?

Thanks.


#2

AVD = Android Virtual Device = Android Emulator

Something is wrong, maybe no device configured? If you have Android Studio, there is a interface to create these.


#3

@Sujan12 - I haven’t removed or changed any of the AVDs I have in AVD Manager and I can still see the list of AVDs that I created quite a long time back.

Any idea on why it is still happening?

Now, I do have another question, I am connecting an Android phone (with developer options enabled) to my laptop. Then I run “ionic run android”, why does it still need AVD or emulator?


#4

No idea - I can only see the error message.

Can you run it with --verbose and paste the complete output here? Maybe there are more hints buried in the details.


#5

@Sujan12 - --verbose was taking a long long time to finish…30 minutes and it still wasn’t done so I stopped (Ctrl + c) it.

Removed the platform and added again, same issue.

Opened AVD Manager from Android Studio and found all the images/AVDs are missing some or the other thing. So updated all of them and ran “ionic run android” again and it worked.

Thought I would share it, in case anybody lands here they will have an option to try. :slight_smile: