android.view.InflateException: Binary XML file line #7: Error inflating class

前情提要:本地代码正常,合并其他分支代码,其他分支页面使用了自定义View,编译成功,运行报错:

java.lang.RuntimeException:

Unable to start activity ComponentInfo{com.example.webview.xxActivity...}:

android.view.InflateException: Binary XML file line #7: Error inflating class CustomView

网上其他办法尝试后均无效,发现本地build tools版本与分支不同

本地: classpath 'com.android.tools.build:gradle:3.6.1'

分支: classpath 'com.android.tools.build:gradle:4.0.0'

可能是分支的框架代码需要高版本支持,修改为分支同版本4.0.0,运行成功。

大家使用了新组件报这个错的话可以看看是否需要升高build版本。

相关推荐
Moshow郑锴15 分钟前
实战分享:用 SpringBoot-API-Scheduler 构建 API 监控闭环 —— 从断言验证到智能警报
java·spring boot·后端·任务调度
JavaNoober20 分钟前
Android 前台服务 "Bad Notification" 崩溃机制分析文档
android
掘我的金34 分钟前
播放器最怕“首帧黑屏”?我给 LibreTV 加了一套缓冲与预加载策略
java
王六岁35 分钟前
UIAutomatorViewer 安装指南 (macOS m3pro 芯片)
android studio
低客的黑调1 小时前
为你的项目选择一个适合的[垃圾收集器]
java·jvm·算法
雨中飘荡的记忆1 小时前
优惠券系统设计与实现
java
1***t8271 小时前
将 vue3 项目打包后部署在 springboot 项目运行
java·spring boot·后端
城东米粉儿1 小时前
关于ObjectAnimator
android
芬加达1 小时前
leetcode34
java·数据结构·算法
__万波__1 小时前
二十三种设计模式(三)--抽象工厂模式
java·设计模式·抽象工厂模式