PhoneGap中文网

标题: 用ionic bulid android 编译apk出错 [打印本页]

作者: 新概念    时间: 2015-9-9 23:18
标题: 用ionic bulid android 编译apk出错
本帖最后由 新概念 于 2015-9-9 23:18 编辑
  1. $ ionic build android
  2. Running command: g:\SOFT\NODEJS\node.exe c:\Users\he\Desktop\myapp\myApp\hooks\a
  3. fter_prepare\010_add_platform_class.js c:/Users/he/Desktop/myapp/myApp
  4. add to body class: platform-android
  5. Running command: cmd "/s /c "c:\Users\he\Desktop\myapp\myApp\platforms\android\c
  6. ordova\build.bat""
  7. ANDROID_HOME=E:\soft\adt-bundle-windows-x86_64-20140702\sdk
  8. JAVA_HOME=C:\Program Files\Java\jdk1.8.0_11
  9. Running: c:\Users\he\Desktop\myapp\myApp\platforms\android\gradlew cdvBuildDebug
  10. -b c:\Users\he\Desktop\myapp\myApp\platforms\android\build.gradle -Dorg.gradle.
  11. daemon=true


  12. BUILD FAILED

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

  15. * Where:
  16. Script 'C:\Users\he\Desktop\myapp\myApp\platforms\android\CordovaLib\cordova.gra
  17. dle' line: 64

  18. * What went wrong:
  19. A problem occurred evaluating root project 'android'.
  20. > No installed build tools found. Please install the Android build tools version
  21. 19.1.0 or higher.

  22. * Try:
  23. Run with --stacktrace option to get the stack trace. Run with --info or --debug
  24. option to get more log output.

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

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

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

作者: 你懂的    时间: 2015-9-10 09:00
25和26行左右代码看看  build tools  19.1.0 or higher 意思就是升级一下  build tools

http://bbs.phonegap100.com/thread-1787-1-1.html 升级离线包下载地址




欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/) Powered by Discuz! X3.2