我已经安装了Visual Studio 2017的Cordova Tools。可以在浏览器仿真中运行它,但是效果很好,但是当我尝试构建APK时,它失败并显示以下错误消息:
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. Warning: 'keystore' and 'alias' need to be specified to generate a signed archive. Validation (CSS 4.0): "cover" is not a valid value for the "background" property. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Picked up _JAVA_OPTIONS: -Xmx512M FAILURE: Build failed with an exception. FAILURE: Build failed with an exception. Error: cmd: Command failed with exit code 1 Error output: A problem occurred configuring root project 'android'. A problem occurred configuring root project 'android'. > Could not resolve all dependencies for configuration ':classpath'. > Could not resolve all dependencies for configuration ':classpath'. * What went wrong: * What went wrong: * Try: * Try: Required by: Required by: > Received fatal alert: protocol_version > Received fatal alert: protocol_version > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not resolve com.android.tools.build:gradle:2.1.0. > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'. > Connection reset > Connection reset :android:unspecified :
android:unspecified
答案 0 :(得分:0)
解决方案是升级到Java 1.8 通过下载JDK,然后将Java主目录指向java 1.8目录 由于TLS1.2应该可以正常工作,并且由于安全性而不再使用TLS1.0和TLS 1.1。 Java 1.8支持TLS1.2 https://stackoverflow.com/a/50824799/10825931