惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Archives - TechRepublic
Security Archives - TechRepublic
罗磊的独立博客
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Register - Security
The Register - Security
J
Java Code Geeks
V2EX - 技术
V2EX - 技术
Vercel News
Vercel News
N
News and Events Feed by Topic
腾讯CDC
P
Proofpoint News Feed
N
News | PayPal Newsroom
www.infosecurity-magazine.com
www.infosecurity-magazine.com
爱范儿
爱范儿
O
OpenAI News
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
D
Docker
Y
Y Combinator Blog
博客园 - 聂微东
G
Google Developers Blog
S
Security @ Cisco Blogs
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
C
CXSECURITY Database RSS Feed - CXSecurity.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
CERT Recently Published Vulnerability Notes
I
Intezer
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
博客园 - Franky
博客园 - 三生石上(FineUI控件)
W
WeLiveSecurity
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
Scott Helme
Scott Helme
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 最新话题
C
Cybersecurity and Infrastructure Security Agency CISA

技术小黑屋

Vibe Coding 的安全风险与应对策略 - 技术小黑屋 Vibe Coding 最佳实践:10 个让开发效率提升 10 倍的关键技巧 一看就会,为 AI 编程 Agent 撸一个 MCP 服务 同样是 Sonnet 4.5,为何 CLI 工具差距这么大 定位 Android 权限声明来源 - 技术小黑屋 Android 升级 targetSDK 35 解决 namespace 问题 解决 Android Studio 关闭后终端 flutter run 进程自动结束的问题 使用 grep 查找关键字并显示上下文行 - 技术小黑屋 Android 开发中的三个常见构建错误及解决方案 - 技术小黑屋 使用 flock 解决 Git `unable to read tree` 问题 幂等性的劣化:从数学确定性到 AI 不确定性 - 技术小黑屋 Android 模拟器实现 hosts 修改 - 技术小黑屋 Vs Code 快速实现 重写 方法 Merge(Pull) Request 推荐的标签列表 - 技术小黑屋 中国特惠!多平台广告屏蔽专家 AdGuard 买断仅需 119 元起 使用 FVM 解决 flutter 3 无法添加 uploader 问题 AAPT2 aapt2-7.2.2-7984345-osx Daemon #5: Idle daemon unexpectedly exit. This should not happen 问题解决 git clone 使用代理,实现百倍加速 - 技术小黑屋 Flutter 处理 Error Setter not found AsciiChar 问题
Could not create task ':generateDebugRFile' 问题小记
androidyue · 2024-11-03 · via 技术小黑屋

前段时间,处理一个比较旧的 flutter plugin,涉及到 Android 的部分,一顿修改后,发现无法 gradle sync 成功。 报错如下,

1
2
3
4
5
6
7
8
9
10
Could not create task ':generateDebugRFile'.
Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

* Try:
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not create task ':generateDebugRFile'.
Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

根据分析上面的错误信息,判定与 gradle 有关,和修改的 kotlin 代码无关。

经过一些简短尝试,最终确定是 gradle 版本不匹配的问题(主要由这一句推断 because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.)。

原因与解法

  • 原因为 Android Gradle Plugin 与 gradle 不匹配。
  • 可以修改 gradle plugin 版本,也可以修改 gradle 版本。

修改 AGP 版本

classpath ‘com.android.tools.build:gradle:7.1.2’ // The Android Gradle plugin.

修改 gradle 版本

修改gradle/wrapper/gradle-wrapper.properties

distributionUrl=https://services.gradle.org/distributions/gradle-8.0-all.zip

修改成(或者对应的gradle 版本) distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip

如何确定 AGP 与 gradle 对应关系

查询,请访问 这里 https://developer.android.com/build/releases/gradle-plugin?#updating-gradle