Я установил Android SDK
, Android Target(API 21)
, Gradle
и JDK
. Я добавил All To Path в системную среду (добавлен gradle / bin), и он не обнаруживает его и выдает ошибку. Это команда, которую я набираю:
C:\Users\HI USER\Desktop\hello>cordova build android
Вывод:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=D:\Android SDK (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Configure project :
Invalid value for java system property 'http.proxyPort': <your proxy Port>. Default port '80' will be used.
Invalid value for java system property 'https.proxyPort': <your proxy Port>. Default port '443' will be used.
Invalid value for java system property 'http.proxyPort': <your proxy Port>. Default port '80' will be used.
Invalid value for java system property 'https.proxyPort': <your proxy Port>. Default port '443' will be used.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
C:\Users\HI USER\Desktop\hello\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
И я попробовал:
C:\Users\HI USER\Desktop\hello>cordova build --stacktrace android
и получил:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=D:\Android SDK (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Configure project :
Invalid value for java system property 'http.proxyPort': <your proxy Port>. Default port '80' will be used.
Invalid value for java system property 'https.proxyPort': <your proxy Port>. Default port '443' will be used.
Invalid value for java system property 'http.proxyPort': <your proxy Port>. Default port '80' will be used.
Invalid value for java system property 'https.proxyPort': <your proxy Port>. Default port '443' will be used.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
C:\Users\HI USER\Desktop\hello\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:3.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
> Could not resolve com.android.tools.build:gradle:3.3.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.0/gradle-3.3.0.pom'.
> Host name may not contain blanks
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Cordova Требования:
C:\Users\HI USER\Desktop\hello>cordova requirements
вывод
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
No android targets (SDKs) installed!
Gradle: installed C:\Gradle\gradle_2.9.8\bin\gradle
Some of requirements check failed