好的,我安装了:
nodejs v 5.4.0(最新)
ant v 1.9.6(最新)
java v 1.8.0_71(最新)
git v 2.7.0(最新)
离子v 1.7.14(最新)
corodva v 6.0.0(最新)
这是我的env变量看起来像: ANT_HOME,JAVA_HOME,ANDROID_HOME变量
我在Windows 10 64bit上运行,但我一直在从离子构建和cordova构建中得到错误,这里是错误的日志(我得到与cordova相同的构建错误):
ionic build
Running command: "C:\Program Files\nodejs\node.exe" C:\work\boaz\myapp\hooks\after_prepare\010_add_platform_class.js C:\work\boaz\myapp
add to body class: platform-android
add to body class: platform-ios
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_65
Unzipping C:\Users\boaz\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094b\gradle-2.2.1-all.zip to C:\Users\boaz\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiejfej094bException in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\work\boaz\myapp\platforms\android\gradlew cdvBuildDebug -b C:\work\boaz\myapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\work\boaz\myapp\platforms\android\gradlew cdvBuildDebug -b C:\work\boaz\myapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
答案 0 :(得分:3)
解决!
我删除了C:\ Users(用户名)\。gradle
下的.gradle文件夹重新运行
ionic build
并且有效。
答案 1 :(得分:0)
Works我刚刚从“C:\ Users \ name”文件夹中删除了.gradle,在控制台上我运行了$ cordova run --devices on git bash并且它有效。
答案 2 :(得分:0)
如果您像我一样手动安装必要的sdk工具,这对我来说就是这个诀窍:
android update sdk --no-ui --all --filter "extra-android-m2repository"