流星雨1.2没有找到安德罗涅德家

时间:2021-03-27 00:24:45

Problem: Meteor cannot find my Android SDK when I try to meteor add-platform android on Linux Mint.

问题:当我在Linux Mint上尝试流星附加平台Android时,流星无法找到我的Android SDK。

I've set my PATH variable: (echo $PATH)

我设置了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

I've got my ANDROID_HOME variable: (echo $ANDROID_HOME)

我有了ANDROID_HOME变量:(echo $ANDROID_HOME)

/home/jimmy/Android/Sdk

But still, when I run sudo meteor add-platform android --verbose I get:

但是,当我运行sudo流星附加平台android时——我得到的是:

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.

4 个解决方案

#1


1  

Okay, so I figured it out? (I guess)

我算出来了?(我猜)

So, I had already had my PATH and ANDROID_HOME set and everything, I could do echo $PATH and echo $ANDROID_HOME and it would print fine; but when I would run the different commands, it wouldn't work.

我已经有了我的PATH和ANDROID_HOME集合以及所有的东西,我可以做echo $PATH和echo $ANDROID_HOME,它会打印得很好;但是当我运行不同的命令时,它就不能工作了。

however, when I run sudo -s and then the commands, it works fine.

但是,当我运行sudo -s和命令时,它工作得很好。

Cheers

干杯

#2


1  

ANDROID_HOME must be set to Android/Sdk folder. In my case (Ubuntu) it is:

必须将ANDROID_HOME设置为Android/Sdk文件夹。在我的例子中(Ubuntu)是:

export ANDROID_HOME="/home/***<user name>***/Android/Sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Put this lines at the end of ~/.profile:

把这条线放在~/.profile的末尾:

$ gedit ~/.profile

Then $ source ~/.profile

然后美元源~ / . profile

#3


0  

I had the same issue (and now I am stuck to Android target), but to solve Android SDK,

我也遇到了同样的问题(现在我仍然坚持使用Android target),但是为了解决Android SDK,

  • go to Android studio and ensure you remove everything from Android 6,
  • 进入Android studio,确保从Android 6中删除所有内容,
  • then that you have Android 5.1.1 installed (with v22 of the platform),
  • 然后安装了Android 5.1.1(平台的v22),
  • restart your console (I had to restart the laptop)

    重启控制台(我必须重启笔记本电脑)

    and normally it doesnt appear again (btw you dont need to use sudo normally)

    ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’

#4


0  

It's possible that since you're using SUDO - that the PATH / ANDROID_HOME are not present in the root user's session. So try either:

由于您正在使用SUDO,所以路径/ ANDROID_HOME可能不在根用户会话中。所以尝试:

sudo -s export PATH=... export ANDROID_HOME=... meteor ...

sudo - s出口路径=…出口ANDROID_HOME =…流星……

or avoid using sudo.

或避免使用sudo。

#1


1  

Okay, so I figured it out? (I guess)

我算出来了?(我猜)

So, I had already had my PATH and ANDROID_HOME set and everything, I could do echo $PATH and echo $ANDROID_HOME and it would print fine; but when I would run the different commands, it wouldn't work.

我已经有了我的PATH和ANDROID_HOME集合以及所有的东西,我可以做echo $PATH和echo $ANDROID_HOME,它会打印得很好;但是当我运行不同的命令时,它就不能工作了。

however, when I run sudo -s and then the commands, it works fine.

但是,当我运行sudo -s和命令时,它工作得很好。

Cheers

干杯

#2


1  

ANDROID_HOME must be set to Android/Sdk folder. In my case (Ubuntu) it is:

必须将ANDROID_HOME设置为Android/Sdk文件夹。在我的例子中(Ubuntu)是:

export ANDROID_HOME="/home/***<user name>***/Android/Sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Put this lines at the end of ~/.profile:

把这条线放在~/.profile的末尾:

$ gedit ~/.profile

Then $ source ~/.profile

然后美元源~ / . profile

#3


0  

I had the same issue (and now I am stuck to Android target), but to solve Android SDK,

我也遇到了同样的问题(现在我仍然坚持使用Android target),但是为了解决Android SDK,

  • go to Android studio and ensure you remove everything from Android 6,
  • 进入Android studio,确保从Android 6中删除所有内容,
  • then that you have Android 5.1.1 installed (with v22 of the platform),
  • 然后安装了Android 5.1.1(平台的v22),
  • restart your console (I had to restart the laptop)

    重启控制台(我必须重启笔记本电脑)

    and normally it doesnt appear again (btw you dont need to use sudo normally)

    ’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’

#4


0  

It's possible that since you're using SUDO - that the PATH / ANDROID_HOME are not present in the root user's session. So try either:

由于您正在使用SUDO,所以路径/ ANDROID_HOME可能不在根用户会话中。所以尝试:

sudo -s export PATH=... export ANDROID_HOME=... meteor ...

sudo - s出口路径=…出口ANDROID_HOME =…流星……

or avoid using sudo.

或避免使用sudo。