2015-09-28 2 views
0

я следовал этому шаг:Кордова ошибка при попытке построить андроид

  1. НОЙ установкой -g Кордовы
  2. Cordova создать привет com.lorenzo.hello привета
  3. кд привет
  4. Cordova платформа добавить андроид
  5. Cordova построить

это дает мне эту ошибку:

C:\Documents and Settings\gcappella\hello>cordova build 
Running command: cmd "/s /c ""C:\Documents and Settings\gcappella\hello\platform 
s\android\cordova\build.bat""" 
ANDROID_HOME=C:\Android 
JAVA_HOME=C:\Programmi\Java\jdk1.8.0_60 
Running: C:\Documents and Settings\gcappella\hello\platforms\android\gradlew cdv 
BuildDebug -b C:\Documents and Settings\gcappella\hello\platforms\android\build. 
gradle -Dorg.gradle.daemon=true 
Downloading http://services.gradle.org/distributions/gradle-2.2.1-all.zip 

Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Serv 
er returned HTTP response code: 403 for URL: http://services.gradle.org/distribu 
tions/gradle-2.2.1-all.zip 
     at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc 
essManager.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: Server returned HTTP response code: 403 for URL: 
http://services.gradle.org/distributions/gradle-2.2.1-all.zip 
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLCo 
nnection.java:1839) 
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon 
nection.java:1440) 
     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(ExclusiveFileAcc 
essManager.java:65) 
     ... 3 more 
Built the following apk(s): 
+0

Это может помочь вам: HTTP: // StackOverflow .com/вопросы/3 1167159/ionic-build-android-failed-with-403-http-respose-from-gradle-java-home-not-vali – bilde

+0

теперь ошибка - это град, который сообщает 403 с maven ... Я пытаюсь установить мой прокси ... – Lorenzo

ответ

0

@Lorenzo, , так как вы недавно построили это, может быть пострадали с необъявленным обновления. Это то что тебе нужно знать.

От PhoneGap построить форум, Petra Adds:

I would add: without announcement, PGB changed the default PGB-version from 3.7.0 to cli-5.2.0. This causes all those who have not set 'phonegap-version' in config.xml to be confronted with the sudden need of splashscreen and whitelist plugins and additional whitelisting specifications in config and html.

Also, several plugins seem not to build correctly with cli-5.2.0, causing log file error messages about "Class ***.java".

FWIW: PhoneGap Построитьadmitted to as much in this tweet

В вашем случае, вы имеете ошибки JAVA, так что мой ключ. Вам нужно установить версию в своей сборке, и вам может потребоваться использовать белый список.

От Top Mistakes by Developers new to Cordova/Phonegap вы попали:

  • # 6 Не устанавливая "версию PhoneGap" для компилятора
  • # 7 Не установка "версии" для вас плагинов
  • # 10 Не добавляйте новые параметры «белый список» и «белый список» в файле config.xml.

Для # 6 & # 7

With the CLI version, if you do not assign a version for your platform OR in ''Phonegap Build'' if you do not set the phonegap-version in config.xml, YOU WILL GET THE LATEST VERSION. If you are lucky, your program just works as expected. If you are not lucky, you'll get a set of cascading error.

Luckily for all of us, Holly Schinsky has written a nice blog post to explain it all:

Cordova/PhoneGap Version Confusion
http://devgirl.org/2014/11/07/cordovaphonegap-version-confusion/

Для # 10

This relatively * NEW * requirement means – to access ANY website or resources on the web, you MUST use the whitelist and the whitelist plugin. This requirement goes into affect, if you are using [email protected] or better; including cli-5.1.1. If however, your version is before 4.0.0, let use say 3.5.0 or 3.7.0, then you will not have to add the white-list requirement.

To be clear, the "whitelist" has been around for a bit, but the plugin and requirement is very new. As you would expect, when the "whitelist" was added, the defacto open-access feature was deprecated. Or said another way, the defacto open-access feature was planned and scheduled to be eliminated. This change marks a step in removal of the open-access feature.

In addition, the Content Security Policy (CSP) has caught numerous developers - because it was soooo poorly publicized. This CSP needs to go in every single HTML page you used, just like you have to wait for 'deviceready'. The documentation is buried in the bottom of many of the latest documentation pages.

Ссылки по теме

Phonegap Build Forum: Notes for upgrading to cli-5.1.1 on PGB and now required Whitelist

+0

это проблема с сетью и прокси ... с помощью телефона в качестве маршрутизатора, который был решен ... но до сих пор не получается, где я должен устанавливать свои настройки прокси-сервера ... я установил npm proxy, gradle.settings .. – Lorenzo

+0

Не может помочь вам с прокси-сервером npm. Удачи. FWIW: Поддержка Gradle была добавлена ​​в [* Phonegap Build * для Android вчера] (http://phonegap.com/blog/2015/09/28/android-using-gradle/). – JesseMonroy650

Смежные вопросы