- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在尝试构建一个 ionic-android 项目,并且我已经安装了 android sdk。
我的项目名称是myApp。我已成功将android平台添加到myApp。但是当我尝试构建项目时
~/myApp$ sudo ionic build android
结果是
Running command: /home/hari/myApp/hooks/after_prepare/010_add_platform_class.js /home/hari/myApp
add to body class: platform-android
ERROR building one of the platforms: 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.
You may not have the required environment or OS to build this project
Error: 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_HOME 和 PATH 变量
echo $ANDROID_HOME
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk/tools:/home/hari/Android/Sdk/platform-tools:/usr/local/bin:/opt/gradle/bin
我见过几乎相同类型的堆栈溢出问题,但没有一个对我有用。我的 android-sdk 配置有什么问题吗?我该如何构建这个项目?
最佳答案
您可能需要确认您的开发环境已正确设置。
引自 spring.io :
Set up the Android development environment
Before you can build Android applications, you must install the Android SDK. Installing the Android SDK also installs the AVD Manager, a graphical user interface for creating and managing Android Virtual Devices (AVDs).
From the Android web site, download the correct version of the Android SDK for your operating system.
Unzip the archive to a location of your choosing. For example, on Linux or Mac, you can place it in the root of your user directory. See the Android Developers web site for additional installation details.
Configure the
ANDROID_HOME
environment variable based on the location of the Android SDK. Additionally, consider addingANDROID_HOME/tools
, andANDROID_HOME/platform-tools
to your PATH.Mac OS X
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-toolsLinux
export ANDROID_HOME=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-toolsWindows
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-toolsThe Android SDK download does not include specific Android platforms. To run the code in this guide, you need to download and install the latest SDK platform. You do this by using the Android SDK and AVD Manager that you installed in the previous section.
Open the Android SDK Manager window:
android
Note: If this command does not open the Android SDK Manager, then your path is not configured correctly.
Select the Tools checkbox.
Select the checkbox for the latest Android SDK.
From the Extras folder, select the checkbox for the Android Support Library.
Click the Install packages... button to complete the download and installation.
Note: You may want to install all the available updates, but be aware it will take longer, as each API level is a large download.
关于android - 找不到 'ANDROID_HOME' 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36198165/
您好,我已经按照所有标准步骤使用 Meteor 安装 Android,但在 mup 部署时遇到以下错误: 错误:ANDROID_HOME 未设置且“android”命令不在您的 PATH 中。你必须
我目前正在设置一个 Appium 平台,它无法找到我的 ANDROID_HOME 路径。我已将 sdk 下载并安装在 Users/User/Android/sdk 中。我的 bash_profile
按照 bitbucket 的 documentation 中的建议,我有以下 bitbucket-pipelines.yml 文件- image: java:8 pipelines: defaul
我尝试在 bash 中设置 ANDROID_HOME,我使用 CentOs 7。首先,尝试使用 export export ANDROID_HOME=/home/zhilevan/Android/S
我最近从事应用程序开发,我在 Windows 7 上使用 WebStorm 作为我的 IDE。 我创建了一个框架 Phonegap/Cordova 项目,并替换了在 Visual Studios 15
为了让 Maven 正常工作,我需要将 ANDROID_HOME 变量设置为指向我的 SDK 目录。我想我需要将其设置为“/Users/kramer65/dev/adt-bundle-mac-x86_
我在测试中使用 viewclient 来按下按钮。但是我得到 ANDROID_HOME path was not set,尽管我在环境变量中设置了它。我正在使用 windows7 操作系统。 File
我的 Android 项目的 git 存储库中有一个 local.properties 文件。在我的构建服务器上,它正在检查 git 并运行 gradle 目标来执行单元测试。构建服务器是 linux
我正在尝试使用 calabash 和 android 进行测试。所以它只是一个启动和安装的葫芦。当我运行时尝试执行第一个测试时出现问题: calabash-android run myAPP.apk
我找到了很多解决方案,但它们都没有帮助我。 我在/home/username/.zshrc中定义了变量 export ANDROID_HOME="/home/username/Android/Sdk"
当我运行 tns run android 或 tns doctor 时,我收到一条错误消息,提示未设置 ANDROID_HOME 环境变量。然而,它是明确设置的。 Mac OSX Sierra 10.
我正在尝试构建一个 ionic-android 项目,并且我已经安装了 android sdk。 我的项目名称是myApp。我已成功将android平台添加到myApp。但是当我尝试构建项目时 ~/m
我在 Google 和 Stack Overflow 上到处寻找答案,但找不到适合我的答案。我正在学习 Cordova,我正在尝试通过终端运行 android 模拟器,当我运行“sudo cordov
似乎我做错了,或者我做错了 我正在使用 ubuntu/基本操作系统 我添加了路径 tail ~/.bashrc 给我这个 export HOME="/home/jsantana" export AND
我在检测 ~/.bashrc 中的 ANDROID_HOME 时遇到了麻烦 当我 flutter doctor 时出现此错误: Doctor summary (to see all detai
我正在从运行 Ubuntu server 20.04 的树莓派 4 运行测试需要 adb(android sdk 工具)。测试已经运行了几个月没有问题。 昨天测试开始失败,出现以下错误: remote
当我运行时 $ionic cordova build android 构建失败并出现此错误: cordova build androidFailed to find 'ANDROID_HOME' en
我正在尝试将 android 添加到我在 ubuntu 上的 meteor 项目,但收到与 $ANDROID_HOME 变量相关的错误。 $ meteor --verbose add-platform
我正在cordova 6.0上工作,为此目的我安装了android studio 3.0.1、nodejs 6.0、jdk 1.8.162,但是当我运行cordova build android命令时
我有 2 个看起来相同的目录, ANDROID_HOME=C:\Android\sdk ANDROID_SDK_HOME=C:\Users[user]\AppData\Local\Android\Sd
我是一名优秀的程序员,十分优秀!