android - 如何识别android数据绑定中的错误?[AGP 4.0 +]
问题描述
最近我注意到数据绑定的错误根本不是描述性的。有人知道如何找到真正的错误消息而不是“后续”错误消息吗?
例如,我收到这样的错误:
...\build\generated\source\kapt\debug\com\company\example\DataBinderMapperImpl.java:18: error: cannot find symbol
import com.company.example.databinding.FragmentApplicationDetailsBindingImpl;
^
symbol: class FragmentApplicationDetailsBindingImpl
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
我从中得到的唯一信息是错误分别FragmentApplicationDetailsBinding
在布局文件中或fragment_application_details.xml
布局文件中。
错误导致绑定文件无法生成,因此它显然丢失了。但没有信息在生成FragmentApplicationDetailsBinding
. :(
解决方案
如果项目不起作用,请尝试清理并重建项目转到文件->使缓存无效/重新启动。
推荐阅读
- unit-testing - 在辅助函数中包装 httptest 方法
- java - 按日期分组 - jpa2 - postgres
- jquery - 在文本 select2 中添加新文本
- kubernetes - 如何删除 kube-proxy 添加的 iptables 规则?
- java - 如何在 Jmeter 中的两个线程组之间共享 JSessionID
- julia - 如何检查我当前的系统映像中可以使用哪些 cpu 功能?
- java - 我有一个多线程 JAVA 应用程序在具有 N 个内核的 CPU 上运行(在 Linux 上)但是它只使用第 0 个内核,其余内核处于空闲状态
- java - 执行 grep 和简单 rhdfs 命令时出现 R 致命错误
- java - 使用 JAXB 检索嵌套的 XML 元素值
- json - 如何在 JSON 中自定义编组映射键