问题:当我在Linux Mint上尝试meteor add-platform android
时,Meteor无法找到我的Android SDK。
我设置了PATH变量:(echo $PATH
)
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/jimmy/Android/Sdk/tools:/home/jimmy/Android/Sdk/platform-tools
我有我的ANDROID_HOME变量:(echo $ANDROID_HOME
)
/home/jimmy/Android/Sdk
但是,当我运行sudo meteor add-platform android --verbose
时,我得到了:
Adding platform Android to Cordova project
% Adding android project...
android: added platform
Checking Cordova requirements for platform Android
Your system does not yet seem to fulfill all requirements to build apps for
Android.
Please follow the installation instructions here:
https://github.com/meteor/meteor/wiki/Mobile-Development-Install:-Android-on-Linux
Status of the requirements:
✓ Java JDK
✗ Android SDK: Failed to find 'ANDROID_HOME' environment variable. Try setting
setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to
include path to valid SDK directory.
✗ Android target: Android SDK not found. Make sure that it is installed. If it
is not at the default location, set the ANDROID_HOME environment variable.
✗ Gradle: Could not find gradle wrapper within Android SDK. Could not find
Android SDK directory.
Might need to install Android SDK or set up 'ANDROID_HOME' env variable.
答案 0 :(得分:1)
好的,我明白了吗? (我猜)
所以,我已经设置了PATH和ANDROID_HOME以及所有内容,我可以执行echo $PATH
和echo $ANDROID_HOME
并且打印正常;但是当我运行不同的命令时,它就无法运行。
然而,当我运行sudo -s
然后运行命令时,它运行正常。
干杯
答案 1 :(得分:0)
我有同样的问题(现在我坚持使用Android目标),但要解决Android SDK,
重启你的控制台(我不得不重启笔记本电脑)
通常它不再出现(顺便说一下你不需要正常使用sudo)
答案 2 :(得分:0)
由于您正在使用SUDO,因此根用户的会话中不存在PATH / ANDROID_HOME。所以尝试:
sudo -s export PATH = ... export ANDROID_HOME = ... 流星......
或避免使用sudo。