当Build 出现,这样的文字以后:
Your build is currently configured to use incompatible Java 21.0.3 and Gradle 7.3.3. Cannot sync the project.
We recommend upgrading to Gradle version 8.9.
The minimum compatible Gradle version is 8.5.
The maximum compatible Gradle JVM version is 17.
Possible solutions:
- Upgrade to Gradle 8.9 and re-sync
- Upgrade to Gradle 8.5 and re-sync
请按照这些步骤下设置,即可解决问题
到Android Studo 目录下 ------> 选择Setting ------> 再来搜索Gradle,选择Build Tools 下的Gradle 模块 ------> 选择Gradle JDK 选择 11.0.18版本
------> 再来进入build.gradle文件,点击Try Again
如果还是无法解决
那么就清空Android Studio 所有的缓存,再来Clean 和Rebuild一下,基本上,就解决了