首页 > cordova build android 出错?在打包APP的时候出错

cordova build android 出错?在打包APP的时候出错

Error: Error code 1 for command: cmd with args: /s,/c,"D:\hello\platforms\android\gradlew cdvBuildDebug -b D:\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

打包的时间就出错,请问我那里设置错误


android环境配置问题,具体可以看看代码山—android打包环境基本配置


ERROR building one of the platforms: Please install Android target: "android-23".

Hint: Open the SDK manager by running: "C:\Program Files (x86)\Android\android-sdk\tools\android.bat"
You will require:

  1. "SDK Platform" for android-23

  2. "Android SDK Platform-tools (latest)

  3. "Android SDK Build-tools" (latest)
    You may not have the required environment or OS to build this project

我按照你给的链接更新过,可是还是出错。好象说缺少了android-23??版本不是最更的?
我已经更新到最新的吧?


我也是碰到了这个问题,我重新start了一个项目就能成功。我把www替换进去,还是失败。于是我逐个替换我改动过的www文件,打包成功了


里面提示的非常清楚了,它说你打包 缺少必要的环境。

  1. 可能 android 的环境变量没有配置

  2. 需要 安装 Android build tools 版本大于等于 19.1.0

点击这里下载

补充信息

  1. 你好这里的 android-23 不是不是指 Android SDK Tools 而是指 android-sdk 的api等级。比如说,你的 android5.0(API 21) 它就是 android-21
    具体查看下图:

  2. 为了解决这个问题,你可以修改你现有的 android 项目的指定版本即可(修改project.properties文件即可)。具体查看下图:

3月4日补充

  1. android list 提示无法载入你之前创建的 emulator 模拟器,建议你删除它,再执行此命令。(另外我推荐一款软件。Genymotion 会比 emulator 性能更高。)

  2. 修改android 的 target 版本,不一定要按照我的截图来,你需要根据你实际安装的sdk api 版本来指定。因为我是使用 android studio 修改 project.properties 会自动刷新整个项目.
    在 project.properties 里面有这样一段话:

# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
你如果想自定义属性使用 ant 编译系统请修改 ant.properties 文件,覆盖和调整属性值在你的项目结构中。(翻译的不好,也就是说,你如果不使用IDE的话,需要自己建立ant.properties)

【热门文章】
【热门文章】