You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AGP 8.0构建失败:realm-android插件API兼容问题及解决方法

Gradle 8.0升级后Realm插件构建失败:API 'android.registerTransform'已移除

问题详情

  • 升级Gradle插件至8.0版本后,使用Realm作为本地数据库的Android项目无法完成构建
  • 项目中Realm插件的配置代码:
apply plugin: 'realm-android'
  • 构建失败的报错信息:
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Work\rc_android_projects\synco\app\build.gradle' line: 15

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'realm-android'.
   > API 'android.registerTransform' is removed.
     
     可通过在命令行添加 -Pandroid.debug.obsoleteApi=true 参数查看调用该API的具体位置。

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

已尝试的方案

  • 切换为Kotlin SDK,问题未得到解决

最终解决方法

将Realm插件升级至10.14.1-transformer-api-SNAPSHOT版本后,项目可正常构建。

内容的提问来源于stack exchange,提问作者Siddharth Shakya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 21:52:51