操作系统:Ubuntu 14.04 框架:Meteor 1.1.0.2 申请名称: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 Desktop/songofy
然后我输入sudo add-platform android
,它要求我接受eprmission然后发生这种情况:
`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变量。
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有什么问题?
答案 0 :(得分:4)
我明白了。这是一个许可问题。因为android是作为用户安装的,并且为用户设置了环境变量,所以sudo无法访问变量。
所以我做的是
sudo -E su
我使用它来为root用户传输环境变量。我运行meteor
它为root安装meteor。执行meteor install-sdk android
它也会为root安装sdk
,然后运行sudo add-platform android
。 Root现在有meteor和android sdk,所以app运行。
希望这会有所帮助。浪费了很多时间。
答案 1 :(得分:1)
我在下面的环境中遇到了同样的问题:
$ANDROID_HOME
设置正确以下是我修复的方法:
Android SDK tools 26
Android SDK tools 25.2.3
(https://dl.google.com/android/repository/tools_r25.2.3-linux.zip)$ANDROID_HOME/tools
SDK manager
$ANDROID_HOME/tools/android
SDK Platform
25.3(Android 7.1.1 API 25)