简体   繁体   中英

In ionic 5 command “ionic cordova run android”

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\66907\AppData\Local\Android\Sdk (DEPRECATED)
Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
[ERROR] An error occurred while running subprocess cordova.

    cordova.cmd build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

You haven't installed the Android SDK properly as indicated by the following two lines in your error log:

ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\66907\AppData\Local\Android\Sdk (DEPRECATED)

If you have previously installed the SDK then add ANDROID_SDK_ROOT with the installation path to your environment. If no SDK is installed yet then the most easy way is installing Android Studio and manage the installation from there. Android studio will also take care of all the environment variables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM