新概念 发表于 2015-9-9 23:18:16

用ionic bulid android 编译apk出错

本帖最后由 新概念 于 2015-9-9 23:18 编辑

$ ionic build android
Running command: g:\SOFT\NODEJS\node.exe c:\Users\he\Desktop\myapp\myApp\hooks\a
fter_prepare\010_add_platform_class.js c:/Users/he/Desktop/myapp/myApp
add to body class: platform-android
Running command: cmd "/s /c "c:\Users\he\Desktop\myapp\myApp\platforms\android\c
ordova\build.bat""
ANDROID_HOME=E:\soft\adt-bundle-windows-x86_64-20140702\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
Running: c:\Users\he\Desktop\myapp\myApp\platforms\android\gradlew cdvBuildDebug
-b c:\Users\he\Desktop\myapp\myApp\platforms\android\build.gradle -Dorg.gradle.
daemon=true


BUILD FAILED

Total time: 13.755 secs
FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\he\Desktop\myapp\myApp\platforms\android\CordovaLib\cordova.gra
dle' 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.

c:\Users\he\Desktop\myapp\myApp\platforms\android\cordova\node_modules\q\q.js:12
6
                  throw e;
                        ^
Error code 1 for command: cmd with args: /s /c "c:\Users\he\Desktop\myapp\myApp\
platforms\android\gradlew cdvBuildDebug -b c:\Users\he\Desktop\myapp\myApp\platf
orms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
    at ChildProcess.whenDone (c:\Users\he\AppData\Roaming\npm\node_modules\cordo
va\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
    at ChildProcess.emit (events.js:110:17)
    at maybeClose (child_process.js:1015:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

he@LIAN ~/Desktop/myapp/myApp{:4_102:}环境已经安装成功,可以用ionic serve能运行成功,用浏览器打开没问题,可以用eclipse打开并编译成功安装到手机运行,唯独不能用命令行编译。求解。。。。。。。

你懂的 发表于 2015-9-10 09:00:35

25和26行左右代码看看build tools19.1.0 or higher 意思就是升级一下build tools

http://bbs.phonegap100.com/thread-1787-1-1.html 升级离线包下载地址
页: [1]
查看完整版本: 用ionic bulid android 编译apk出错