Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加载自定义底部导航栏崩溃 #45

Closed
panyy opened this issue Apr 7, 2022 · 7 comments
Closed

加载自定义底部导航栏崩溃 #45

panyy opened this issue Apr 7, 2022 · 7 comments

Comments

@panyy
Copy link

panyy commented Apr 7, 2022

No description provided.

@panyy
Copy link
Author

panyy commented Apr 7, 2022

微信截图_20220407104222

@DylanCaiCoding
Copy link
Owner

使用的是最新版吗?新版应该不会报 InvocationTargetException

@panyy
Copy link
Author

panyy commented Apr 7, 2022

用的最新的2.0.4版

@panyy
Copy link
Author

panyy commented Apr 7, 2022

我发现布局里有com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx这个自定义view不行,其他自定义view没有问题

@DylanCaiCoding
Copy link
Owner

这里报错是反射到了泛型,但是调用 ActivityMainBinding.inflate(layoutInflater) 时崩溃了,而反射会把异常信息包装成 InvocationTargetException。你手动调下 ActivityMainBinding.inflate(layoutInflater) 看下报的什么异常,这才是真正导致崩溃的原因。

之前有个人反馈类似的问题是少加了个控件的配置,感觉你的也是这个原因。

@panyy
Copy link
Author

panyy commented Apr 7, 2022

微信截图_20220407122602
这样引入就没有问题,库里用的material的1.4,我项目用的1.3,然后就报错了。

@DylanCaiCoding
Copy link
Owner

发了 2.0.5 版本,不会再报 InvocationTargetException,会抛出具体的异常。另外把 material 的版本降为 1.3.0,1.4.0 好像是有点高

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants