首页 > 解决方案 > 升级到 Android Studio 北极狐 Beta 4 后无法构建

问题描述

今天刚注意到Arctic Fox 更新了Beta 4。之前没有问题,我决定升级我的Beta 3。与往常一样,AGP 也需要升级。在我尝试使用新的 Gradle n AGP 构建项目之前,新的 Beta 版似乎运行良好。每次都出现此错误,除了恢复到北极狐 beta 3 或其正常发行版本外,我尝试过的任何方法(包括消息中建议的步骤)都无效。想知道这里是否有人知道原因并对此有解决方案

Unable to find method com.android.build.api.extension.VariantSelector com.android.build.api.extension.AndroidComponentsExtension.selector()
com.android.build.api.extension.VariantSelector com.android.build.api.extension.AndroidComponentsExtension.selector()

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.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

标签: androidandroid-studioandroid-gradle-pluginbeta

解决方案


如果您使用 Hilt,则必须等待 AGP 7 beta05。
在此处链接到 Hilt 问题


推荐阅读