流星:ANDROID_HOME 未设置,即使已设置 [英] Meteor: ANDROID_HOME is not set even though it is set
问题描述
操作系统:Ubuntu 14.04框架:Meteor 1.1.0.2应用名称:Songofy
OS : Ubuntu 14.04 Framework: Meteor 1.1.0.2 Application Name: Songofy
这是meteor install-sdk android
的输出
meteor install-sdk android
✓ Found Android bundle
✓ A JDK is installed
✓ Found Android Platform tools
✓ Found Android Build Tools
✓ Found Android 19 API
✓ Found suitable Android x86 image
✓ 'meteor' android virtual device (AVD) found
✗ Android emulator acceleration is not installed
(The Android emulator will be very slow without acceleration)
Platform requirements not yet met
Please follow the instructions here:
https://github.com/meteor/meteor/wiki/Mobile-Dev-Install:-Android-on-Linux#haxm
我使用 cd 进入目录
I cd into the Directory using
cd Desktop/songofy
然后我输入 sudo add-platform android
,它要求我接受 eprmission,然后发生这种情况:
Then I type sudo add-platform android
, and it asks me to accept the eprmission and then this happens:
`You must agree to the terms to proceed.
Do you agree (Y/n)? Y
/home/abhishek/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
throw(ex);
^
Error: Error running /home/abhishek/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/tools/cordova-scripts/cordova.sh
/home/abhishek/.meteor/android_bundle/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126
throw e;
^
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
我使用这个添加了 ANDROID_HOME 变量.
I add the ANDROID_HOME variable using this.
abhishek@TiltedLines:~/Desktop/songofy$ export ANDROID_HOME=~/.meteor/android_bundle/android-sdk
abhishek@TiltedLines:~/Desktop/songofy$ export PATH=$ANDROID_HOME/tools:$PATH
abhishek@TiltedLines:~/Desktop/songofy$ export PATH=$ANDROID_HOME/platform-tools:$PATH
Cordova 和 Meteor 有什么问题?
What is the problem with Cordova and Meteor?
推荐答案
我想通了.这是一个许可问题.因为android是作为用户安装的,并且为用户设置了环境变量,sudo无法访问这些变量.
I figured it out. It was a permission issue. Because the android is installed as a user and the environment variable were set for the user, sudo cannot access the variables.
所以我做的是
sudo -E su
我正在使用它为 root 用户传输环境变量.我运行 meteor
它为 root 安装流星.执行 meteor install-sdk android
它也会为 root 安装 sdk
,然后运行 sudo add-platform android
.Root 现在有meteor 和android sdk,所以应用程序运行.
I am using this to transfer the environment variables for root user. I run meteor
it installs meteor for root. do a meteor install-sdk android
it installs the sdk
for root as well, then run sudo add-platform android
. Root has both meteor and the android sdk now, so the app runs.
希望这会有所帮助.浪费了很多时间.
Hope this helps. Wasted a lot of time on this.
这篇关于流星:ANDROID_HOME 未设置,即使已设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!