문제 설명
Ionic 빌드 Android를 수행하는 동안 오류가 발생했습니다. (Error while doing Ionic build android)
나는 따라야 할 모든 튜토리얼을 따르고 설정을 올바르게 수행했습니다. 다음 오류가 발생합니다.
[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 변수에 Android SDK의 경로를 추가하는 것입니다.
출력은 다음과 같습니다.
echo $PATH
6/home/samyak/anaconda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ sbin:/bin:/usr/games:/usr/local/games:/usr/local/java/jdk1.8.0_65/bin:/usr/local/java/jdk1.8.0_65/jre/bin:/usr/ local/java/jdk1.8.0_65/bin:/usr/local/java/jdk1.8.0_65/jre/bin:/home/samyak/Android/Sdk/tools:/home/samyak/Android/Sdk/platform‑tools
echo $ANDROID_HOME
/home/samyak/Android/Sdk
Android를 하자마자 Android의 GUI를 얻습니다. 내가 뭔가를 놓치고 있다고 생각합니다. 누군가가 나를 도울 수 있다면
Version details
Ionic 1.7.11
Cordova 5.4.0
Android‑sdk 23
또한 Android Sdk를 다운로드하지 않고 하드 드라이브를 통해 친구로부터 가져왔다는 점에 유의해야 합니다. 내 안드로이드 빌드에 영향을 미치나요?
참조 솔루션
방법 1:
Make sure you have the Android Tools inside the path folder.After you have the Android SDK
downloaded and installed, you need to install build tools
for the version of android you're targeting. You will need to check:
Tools
Targeted Android API Version
Extras
and hit Install
in the Android SDK Manager
. If something is missing after this, install what build tool is complaining about.
(by Samyak Jain、Prashant G)