您现在的位置是:首页 >其他 >Android Studio 升级 Flamingo 后 Gradle 又挂了网站首页其他

Android Studio 升级 Flamingo 后 Gradle 又挂了

海天鹰 2023-05-17 20:00:02
简介Android Studio 升级 Flamingo 后 Gradle 又挂了

1.Gradle 7.2 才支持 Java 17

Unsupported Java.
Your build is currently configured to use Java 17.0.6 and Gradle 5.0.

Possible solution:
 - Upgrade Gradle wrapper to 7.2 version and re-import the project

 
2.Android plugin 7.1 才支持 Gradle 7.2

Unable to find method ''org.gradle.api.file.DirectoryProperty org.gradle.api.file.ProjectLayout.directoryProperty(org.gradle.api.provider.Provider)''
'org.gradle.api.file.DirectoryProperty org.gradle.api.file.ProjectLayout.directoryProperty(org.gradle.api.provider.Provider)'

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

Change Android plugin version to 7.1

3.阿里云的maven镜像仓库没有 gradle-7.1.pom

Could not find com.android.tools.build:gradle:7.1.
Searched in the following locations:
  - https://maven.aliyun.com/nexus/content/groups/public/com/android/tools/build/gradle/7.1/gradle-7.1.pom
  - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.1/gradle-7.1.pom
Required by:
    project :

在华为云里找到了:

https://mirrors.huaweicloud.com/repository/maven/com/android/tools/build/gradle/7.1.0/gradle-7.1.0.pom

修改为 maven { url 'https://mirrors.huaweicloud.com/repository/maven/'}

风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。