首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >找不到方法PackageAndroidArtifact.getOutputDirectory()

找不到方法PackageAndroidArtifact.getOutputDirectory()
EN

Stack Overflow用户
提问于 2021-05-17 19:38:16
回答 1查看 811关注 0票数 0

在更新了一个使用gradle 6.7.1和Android 4.2.1的项目之后,我得到了以下错误:

代码语言:javascript
运行
复制
Unable to find method ''java.io.File com.android.build.gradle.tasks.PackageAndroidArtifact.getOutputDirectory()''
'java.io.File com.android.build.gradle.tasks.PackageAndroidArtifact.getOutputDirectory()'

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.

尝试1)无效的缓存/重新启动作为2)清理重建项目3)删除.gradle和.build文件夹

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-25 07:57:26

我有同样的问题,我解决了将SDK版本更改为30.0.2,根据官方文档:https://developer.android.com/studio/releases/gradle-plugin#compatibility

此外,我还需要更新主build.gradle文件(顶级)中的其他插件版本。“您的项目可能使用与项目中的其他插件或项目所要求的Gradle版本不兼容的第三方插件。”

我希望这对你也有帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67576051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档