PhoneGap中文网

 找回密码
 立即注册

新人求助,cordova build 执行不成功的问题

查看数: 44973 | 评论数: 5 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-3-17 16:19

正文摘要:

D:\>cordova create hello com.example.hello HelloWorld Creating a new cordova project. D:\>cd hello D:\hello>cordova platform add android Adding android project... Creating Cordova project for the An ...

回复

随风飘 发表于 2016-4-1 17:02:58
编译不成功,可能是Android SDK的问题,使用代理,把最新的SDK更新,全点上去下载,我之前也试过这种情况,把Android 6.0的sdk全下了就可以了
tanxuxu123 发表于 2016-3-22 17:53:19
我也遇到这样问题,怎么解的
weiweicat333 发表于 2016-3-17 16:46:05
本帖最后由 weiweicat333 于 2016-3-17 16:47 编辑
随风飘 发表于 2016-3-17 16:35
是不是项目那里安装了不能使用的插件,把部分插件卸了试下?

您好,非常感谢您的回帖,我查看了一下,我这个插件只有cordova-plugin-whitelist 1.2.1 "Whitelist",删除了这个插件之后,在编译的时候,还会出现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"这个错误。不知道哪里出现了问题。

D:\hello>cordova plugin ls
cordova-plugin-whitelist 1.2.1 "Whitelist"

D:\hello>cordova plugin rm cordova-plugin-whitelist
Uninstalling cordova-plugin-whitelist from android
Uninstalling cordova-plugin-whitelist from browser
Removing "cordova-plugin-whitelist"

D:\hello>cordova build android
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "cordova-plugin-whitelist" for browser
ANDROID_HOME=D:\adt-bundle-windows-x86-20130917\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_73
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Error writing to server
        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.io.IOException: Error writing to server
        at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:666)
        at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:678)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1534)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
        at org.gradle.wrapper.Download.download(Download.java:45)
        at org.gradle.wrapper.Install$1.call(Install.java:60)
        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,"D:\hello\platforms\android\gradlew cdvBuildDebug -b D:\hello\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,"D:\hello\platforms\android\gradlew cdvBuildDebug -b D:\hello\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

D:\hello>cordova platform ls
Installed platforms: android 5.1.1, browser 4.0.0
Available platforms: amazon-fireos, blackberry10, firefoxos, webos, windows, windows8, wp8

D:\hello>cordova platform rm browser

D:\hello>cordova platform ls
Installed platforms: android 5.1.1
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, webos, windows, windows8, wp8
随风飘 发表于 2016-3-17 16:35:49
是不是项目那里安装了不能使用的插件,把部分插件卸了试下?
关闭

站长推荐 上一条 /1 下一条

ionic4视频教程

Archiver|手机版|小黑屋| PhoneGap中文网 ( 京ICP备13027796号-1 )  

GMT+8, 2024-11-6 03:37 , Processed in 0.067071 second(s), 37 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表