PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT

后端 未结 6 980
旧巷少年郎
旧巷少年郎 2020-12-28 12:06

I\'m trying to run my first Ionic app but i\'m getting this error where it does not find my phone and does not find the emulator to run either.

C:\\Users\\MA         


        
相关标签:
6条回答
  • 2020-12-28 12:43

    I had the same problem and none of the answers here solved my issue, I think the reason in my case was either Ionic framework or and most probably Native Script framework. Native Script uses the Android Studio emulator to link to their mobile apps so they change the Andriod Studio emulator's path. What I did to solve the issue:

    1.Unistall Ionic, Cordova, and Native Script - I'm not sure if this step is necessary

    2- Uninstall Android Studio and deleting the folder Android in AppData/Local folder

    3- Install Andriod Studio and make sure not to import settings

    1- Unistall Ionic, Cordova, and Native Script I'm not sure if this step is necessary

    For Window system

    npm uninstall -g ionic
    npm uninstall -g cordova
    npm uninstall -g nativescript
    

    2- Uninstall Android Studio

    • Uninstall Android Studio from control panel
    • Delete the folder users/${yourUserName}/appData/Local/Android (Show hidden files to see appData folder)

    3- Reinstall Android Studio

    • Make sure not to import settings

    After that you might want to install the frameworks again, I did not

    0 讨论(0)
  • 2020-12-28 12:47

    For me, the issue was a wrong ANDROID_HOME environment variable on mac, I had to use the homebrew version. Added this to the .zshrc:

    export ANDROID_HOME=$(brew --prefix)/share/android-sdk
    
    0 讨论(0)
  • 2020-12-28 12:49

    AVD cant find SDK root, possibly because they are in a different directory.Set your environment variables as shown in below screenshot:

    0 讨论(0)
  • 2020-12-28 12:52

    First try this: If you are using a device. then just ensure that the device is well-connected. Check in the android studio that, the device is online. This error pops up usually when the device is offline.

    If it does not work, https://stackoverflow.com/a/39711435/6747251

    0 讨论(0)
  • 2020-12-28 12:59

    I got this error when trying to run it on a Kindle Fire. Enable ADB on the Kindle Fire and via your project: https://developer.amazon.com/docs/fire-tablets/connecting-adb-to-device.html#install-the-usb-driver-windows-users

    I used VS code and the built in terminal running the command: ionic cordova run android

    0 讨论(0)
  • 2020-12-28 13:00

    I have same issue when I run my ionic 2 app on windows (ionic run android), and I solve it by following these steps, hope it will help you.

    1- Start your Android Studio.

    2- Create a New Project to be able to create or delete virtual devices.

    3- Delete any virtual devices if found.

    4- and create virtual device via AVD manager as shown below .

    0 讨论(0)
提交回复
热议问题