./gradlew app:installDebug
只见日志中出现了以下内容:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.0.2'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
当我运行
./gradlew --version
时,我得到了以下结果:FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '11.0.2'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
我的
.../gradle/wrapper/gradle-wrapper.properties
包含以下内容,包括 distributionUrl=.../gradle-4.1-rc-1-all.zip
:distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
gradle --version
还是./gradlew --version
命令得出的?基于 Gradle 的项目通常使用 wrapper 来使不同的开发者可以使用相同的 Gradle 版本来构建项目,这也使得构建更加稳定。 - Slawgradle --version
的版本。 - lesley2958