Meteor:当我尝试通过 Ubuntu 构建时找不到 ANDROID_HOME,即使我设置了正确的路径
Meteor: Cannot find the ANDROID_HOME when I try to build via Ubuntu even though I set the correct path
我尝试为 Android 构建我的 Meteor 项目。如所见:
Generate apk file for meteor app
因此,在我的 Ubuntu 机器上,我从以下位置安装了 android SDK:https://developer.android.com/studio/index.html 它说:"Get just the command line tools"。安装路径为/home/pcmagas/Λήψεις/tools
,包含以下文件:
drwxr-xr-x 6 pcmagas pcmagas 4096 Ιούλ 19 11:43 ./
drwxr-xr-x 4 pcmagas pcmagas 4096 Ιούλ 19 11:43 ../
-rwxr--r-- 1 pcmagas pcmagas 4741 Μάρ 29 00:46 android*
drwxr-xr-x 2 pcmagas pcmagas 4096 Μάρ 29 00:46 bin/
-rwxr--r-- 1 pcmagas pcmagas 643536 Μάρ 29 00:46 emulator*
-rwxr--r-- 1 pcmagas pcmagas 394336 Μάρ 29 00:46 emulator-check*
drwxr-xr-x 6 pcmagas pcmagas 4096 Μάρ 29 00:46 lib/
-rwxr--r-- 1 pcmagas pcmagas 12191 Μάρ 29 00:46 mksdcard*
-rwxr--r-- 1 pcmagas pcmagas 1257 Μάρ 29 00:46 monitor*
-rw-r--r-- 1 pcmagas pcmagas 629709 Μάρ 29 00:46 NOTICE.txt
-rw-rw-r-- 1 pcmagas pcmagas 919 Ιούλ 19 11:43 package.xml
drwxr-xr-x 7 pcmagas pcmagas 4096 Μάρ 29 00:46 proguard/
-rw-r--r-- 1 pcmagas pcmagas 139 Μάρ 29 00:46 source.properties
drwxr-xr-x 2 pcmagas pcmagas 4096 Μάρ 29 00:46 support/
我还用这个值导出了 ANDROID_HOME
环境变量:
echo $ANDROID_HOME
/home/pcmagas/Λήψεις/tools
和PATH
变量变成这样:
export PATH=${PATH}:$ANDROID_HOME
然后我 cd
我的流星项目,我给出以下命令:
meteor add-platform android
但我收到以下错误:
✗ 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. Might need to update your Android SDK.
Looked here: /home/pcmagas/Λήψεις/tools/tools/templates/gradle/wrapper
我也试过:
export PATH="$PATH:$ANDROID_HOME/bin"
仍然没有成功。
编辑 1:
请记住,我已经看到了:
- Cordova: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable
仍然没有成功。
编辑 2:
我运行:
sdkmanager "build-tools;25.0.3"
现在我得到了唯一的错误:
✗ Gradle: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /home/pcmagas/Λήψεις/SDK/tools/tools/templates/gradle/wrapper
另外我把ANDROID_HOME
改成了/home/pcmagas/Λήψεις/SDK/tools
并将SDK生成的所有文件夹移动到:/home/pcmagas/Λήψεις/SDK/
.
ANDROID_HOME
环境变量应该 link 直接到您的 Android SDK 文件夹,而不是它的 tools
子文件夹。
export ANDROID_HOME=/home/pcmagas/Λήψεις/SDK
您仍然可以将 tools
子文件夹(如果需要,还可以添加 platform-tools
)到您的 PATH:
PATH="$ANDROID_HOME/tools:$PATH"
PATH="$ANDROID_HOME/platform-tools:$PATH"
我尝试为 Android 构建我的 Meteor 项目。如所见:
Generate apk file for meteor app
因此,在我的 Ubuntu 机器上,我从以下位置安装了 android SDK:https://developer.android.com/studio/index.html 它说:"Get just the command line tools"。安装路径为/home/pcmagas/Λήψεις/tools
,包含以下文件:
drwxr-xr-x 6 pcmagas pcmagas 4096 Ιούλ 19 11:43 ./
drwxr-xr-x 4 pcmagas pcmagas 4096 Ιούλ 19 11:43 ../
-rwxr--r-- 1 pcmagas pcmagas 4741 Μάρ 29 00:46 android*
drwxr-xr-x 2 pcmagas pcmagas 4096 Μάρ 29 00:46 bin/
-rwxr--r-- 1 pcmagas pcmagas 643536 Μάρ 29 00:46 emulator*
-rwxr--r-- 1 pcmagas pcmagas 394336 Μάρ 29 00:46 emulator-check*
drwxr-xr-x 6 pcmagas pcmagas 4096 Μάρ 29 00:46 lib/
-rwxr--r-- 1 pcmagas pcmagas 12191 Μάρ 29 00:46 mksdcard*
-rwxr--r-- 1 pcmagas pcmagas 1257 Μάρ 29 00:46 monitor*
-rw-r--r-- 1 pcmagas pcmagas 629709 Μάρ 29 00:46 NOTICE.txt
-rw-rw-r-- 1 pcmagas pcmagas 919 Ιούλ 19 11:43 package.xml
drwxr-xr-x 7 pcmagas pcmagas 4096 Μάρ 29 00:46 proguard/
-rw-r--r-- 1 pcmagas pcmagas 139 Μάρ 29 00:46 source.properties
drwxr-xr-x 2 pcmagas pcmagas 4096 Μάρ 29 00:46 support/
我还用这个值导出了 ANDROID_HOME
环境变量:
echo $ANDROID_HOME
/home/pcmagas/Λήψεις/tools
和PATH
变量变成这样:
export PATH=${PATH}:$ANDROID_HOME
然后我 cd
我的流星项目,我给出以下命令:
meteor add-platform android
但我收到以下错误:
✗ 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. Might need to update your Android SDK.
Looked here: /home/pcmagas/Λήψεις/tools/tools/templates/gradle/wrapper
我也试过:
export PATH="$PATH:$ANDROID_HOME/bin"
仍然没有成功。
编辑 1:
请记住,我已经看到了:
- Cordova: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable
仍然没有成功。
编辑 2:
我运行:
sdkmanager "build-tools;25.0.3"
现在我得到了唯一的错误:
✗ Gradle: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /home/pcmagas/Λήψεις/SDK/tools/tools/templates/gradle/wrapper
另外我把ANDROID_HOME
改成了/home/pcmagas/Λήψεις/SDK/tools
并将SDK生成的所有文件夹移动到:/home/pcmagas/Λήψεις/SDK/
.
ANDROID_HOME
环境变量应该 link 直接到您的 Android SDK 文件夹,而不是它的 tools
子文件夹。
export ANDROID_HOME=/home/pcmagas/Λήψεις/SDK
您仍然可以将 tools
子文件夹(如果需要,还可以添加 platform-tools
)到您的 PATH:
PATH="$ANDROID_HOME/tools:$PATH"
PATH="$ANDROID_HOME/platform-tools:$PATH"