gpt4 book ai didi

cordova - 获取 android : No valid Android SDK root found 的 native 目标时出错

转载 作者:行者123 更新时间:2023-12-05 02:45:56 26 4
gpt4 key购买 nike

我正在尝试运行命令:

ionic cordova run android

并且总是出现这个错误:

[ERROR] Error while getting native targets for android: No validAndroid SDK root found.

This error occurred while using native-run. You can try running this command with --no-native-run, which willrevert to using Cordova.

环境:

Ionic:

Ionic CLI : 6.12.3 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.8.9
@angular-devkit/schematics : 0.8.9
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.3.0

Cordova:

Cordova CLI : 7.1.0
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.3, (and 13 other plugins)

Utility:

cordova-res : 0.15.2
native-run : 1.3.0

System:

NodeJS : v14.15.4 (/usr/local/bin/node)
npm : 2.15.12
OS : Linux 4.15

~/.bashrc:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export ANDROID_HOME="~/Android/Sdk"
export ANDROID_SDK_ROOT="~/Android/Sdk"

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator

最佳答案

ionic cordova run android --device

只需在您的设备中使用此代码和插件即可,希望它能正常工作

关于cordova - 获取 android : No valid Android SDK root found 的 native 目标时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65690595/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com