ionic 프로젝트의 루트에서 ionic build android 명령을 실행할 때 다음 오류가 발생합니다.
실패 : 예외로 인해 빌드가 실패했습니다.
Where : 스크립트 '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle'줄 : 64
문제 : 루트 프로젝트 'android'를 평가하는 중에 문제가 발생했습니다.
설치된 빌드 도구가 없습니다. Android 빌드 도구 버전 19.1.0 이상을 설치하세요.
시도 : --stacktrace 옵션으로 실행하여 스택 추적을 가져옵니다. 더 많은 로그 출력을 얻으려면 --info 또는 --debug 옵션과 함께 실행하십시오.
javad@javad:~/Desktop/javadApp$ ionic build android
Running command: /home/javad/Desktop/javadApp/hooks/after_prepare/010_add_platform_class.js /home/javad/Desktop/javadApp
add to body class: platform-android
Running command: /home/javad/Desktop/javadApp/platforms/android/cordova/build
ANDROID_HOME=/opt/android-sdk
JAVA_HOME=/usr/lib/jvm/default-java
Running: /home/javad/Desktop/javadApp/platforms/android/gradlew cdvBuildDebug -b /home/javad/Desktop/javadApp/platforms/android/build.gradle -Dorg.gradle.daemon=true
FAILURE: Build failed with an exception.
* Where:
Script '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle' line: 64
* What went wrong:
A problem occurred evaluating root project 'android'.
> No installed build tools found. Please install the Android build tools version 19.1.0 or higher.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.564 secs
/home/javad/Desktop/javadApp/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/javad/Desktop/javadApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/javad/Desktop/javadApp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /home/javad/Desktop/javadApp/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: /home/javad/Desktop/javadApp/platforms/android/cordova/build: Command failed with exit code 8
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
~ / .profile에는 다음이 있습니다.
내보내기 PATH = $ PATH : / opt / android-sdk / tools
export PATH = $ PATH : / opt / android-sdk / platform-tools
내보내기 PATH = $ PATH : / opt / node / bin
내보내기 JAVA_HOME = / usr / lib / jvm / default-java
export ANDROID_HOME = / opt / android-sdk
$ PATH는 다음과 같습니다.
/ usr / local / sbin : / usr / local / bin : / usr / sbin : / usr / bin : / sbin : / bin : / usr / games : / usr / local / games : / opt / android-sdk / tools : / opt / android-sdk / platform-tools : / opt / node / bin
중요한 문제 :
파일 : /home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova.gradle | 38 행 :
String[] getAvailableBuildTools() {
def buildToolsDir = new File(getAndroidSdkDir(), "build-tools")
buildToolsDir.list()
.findAll { it ==~ /[0-9.]+/ }
.sort { a, b -> compareVersions(b, a) }
}
방금 반환 된 / opt / android-sdk / build-tools !!!
에서 / 옵션 / 안드로이드 SDK / 빌드 도구는 내가 가진 폴더 :
추출 된 android-5.1 폴더 : https://dl.google.com/android/repository/build-tools_r22-linux.zip