當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一下,基本上,就解決了