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

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
T
Threatpost
G
Google Developers Blog
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Exploit Database - CXSecurity.com
H
Heimdal Security Blog
Google DeepMind News
Google DeepMind News
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
Hacker News: Ask HN
Hacker News: Ask HN
www.infosecurity-magazine.com
www.infosecurity-magazine.com
S
Schneier on Security
B
Blog
V2EX - 技术
V2EX - 技术
NISL@THU
NISL@THU
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
C
Cybersecurity and Infrastructure Security Agency CISA
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Y
Y Combinator Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog
V
Vulnerabilities – Threatpost
N
Netflix TechBlog - Medium
Schneier on Security
Schneier on Security
F
Fortinet All Blogs
N
News | PayPal Newsroom
Attack and Defense Labs
Attack and Defense Labs
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
S
Security @ Cisco Blogs
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
Project Zero
Project Zero
I
Intezer
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler

技术小黑屋

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