我首先创建了一个新的 flutter 项目。
但我收到了这个错误:
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\Java\jre1.8.0_261' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
* 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 33s
Exception: Gradle task assembleDebug failed with exit code 1
我也尝试过这个方法,但是没有效果。
Step1:
我将以下行添加到 gradle.properties 文件中
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_261
你的jdk版本
Step2:
将以下行添加到 gradle-wrapper.properties 文件
到地址 =>\flutter_app\android\gradle\wrapper\gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)