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

SmartRefreshLayout自定义RefreshHeader时,报java.lang.NoSuchMethodException的错误 #34

Closed
skyCracks opened this issue Jul 14, 2022 · 13 comments

Comments

@skyCracks
Copy link

升级到1.1.5版本之后,SmartRefreshLayout自定义RefreshHeader时,报java.lang.NoSuchMethodException的错误:
Caused by: java.lang.NoSuchMethodException:com.xxx.xxx.databinding.LayoutCommonRefreshHeaderBinding.inflate [class android.view.LayoutInflater, class android.view.ViewGroup]
at java.lang.Class.getMethod(Class.java:2072)
at java.lang.Class.getMethod(Class.java:1693)
at com.hi.dhl.binding.ReflectExtKt.inflateMethodWithViewGroup(ReflectExt.kt:21)
at com.hi.dhl.binding.viewbind.ViewGroupViewBinding.(ViewGroupViewBinding.kt:36)
查看源码源码发现1.1.5版本viewbind扩展方法强制要求传入viewGroup引起的,自定义的RefreshHeader是通过addview方式添加进SmartRefreshLayout里面的。viewbind改回不传入viewGroup方式可正常使用,建议增加viewGroup可空的方法。

@hi-dhl
Copy link
Owner

hi-dhl commented Jul 14, 2022

收到,我处理一下

@hi-dhl
Copy link
Owner

hi-dhl commented Aug 14, 2022

1.1.6上修复了这个问题,将关闭issue,感谢你的反馈

@hi-dhl hi-dhl closed this as completed Aug 14, 2022
@skyCracks
Copy link
Author

文档更新日志打成1.1.16版本了,1.1.6版本引入后缺失代码:
微信图片_20220816112425

@hi-dhl
Copy link
Owner

hi-dhl commented Aug 19, 2022

收到,新的gralde插件问题,我查一下

@hi-dhl
Copy link
Owner

hi-dhl commented Aug 22, 2022

已经修复,可以升级到新版本 1.1.8

@DQSecret
Copy link

DQSecret commented Sep 2, 2022

image

@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

@hi-dhl
Copy link
Owner

hi-dhl commented Sep 2, 2022

image

@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

可以先使用 1.1.5 的版本 1.1.6 以后的版本只是修改了 ViewGroup 初始化的问题,应该不会影响你这边的使用

这个错很奇怪,你当前的使用的 JDK 1.8 吗?

@DQSecret
Copy link

DQSecret commented Sep 5, 2022

image
@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

可以先使用 1.1.5 的版本 1.1.6 以后的版本只是修改了 ViewGroup 初始化的问题,应该不会影响你这边的使用

这个错很奇怪,你当前的使用的 JDK 1.8 吗?

是的,项目的 JDK 版本是 1.8,没有升级到 11 的打算。
我先用 1.1.5 吧。

@KarenKaKa
Copy link

image

@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

使用1.1.5报错,改成1.1.8又出现了这个问题。

@hi-dhl
Copy link
Owner

hi-dhl commented Sep 15, 2022

image
@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

使用1.1.5报错,改成1.1.8又出现了这个问题。

因为升级gradle 7的原因,所以 1.1.8 需要升级到 java 11, 这个问题我统一处理一下, 另外 1.1.5 出现什么错了,方便贴一下吗

@KarenKaKa
Copy link

image
@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

使用1.1.5报错,改成1.1.8又出现了这个问题。

因为升级gradle 7的原因,所以 1.1.8 需要升级到 java 11, 这个问题我统一处理一下, 另外 1.1.5 出现什么错了,方便贴一下吗

自定义view使用binding报错如下:

Caused by: java.lang.NoSuchMethodException: inflate [class android.view.LayoutInflater, class android.view.ViewGroup]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getMethod(Class.java:1690)
at com.hi.dhl.binding.ReflectExtKt.inflateMethodWithViewGroup(ReflectExt.kt:21)
at com.hi.dhl.binding.viewbind.ViewGroupViewBinding.(ViewGroupViewBinding.kt:36)

@hi-dhl
Copy link
Owner

hi-dhl commented Oct 20, 2022

image
@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

使用1.1.5报错,改成1.1.8又出现了这个问题。

因为升级gradle 7的原因,所以 1.1.8 需要升级到 java 11, 这个问题我统一处理一下, 另外 1.1.5 出现什么错了,方便贴一下吗

自定义view使用binding报错如下:

Caused by: java.lang.NoSuchMethodException: inflate [class android.view.LayoutInflater, class android.view.ViewGroup]
at java.lang.Class.getMethod(Class.java:2068)
at java.lang.Class.getMethod(Class.java:1690)
at com.hi.dhl.binding.ReflectExtKt.inflateMethodWithViewGroup(ReflectExt.kt:21)
at com.hi.dhl.binding.viewbind.ViewGroupViewBinding.(ViewGroupViewBinding.kt:36)

这个问题,新版本已经修复了,可以拉起一下最新的代码

@hi-dhl
Copy link
Owner

hi-dhl commented Oct 20, 2022

image
@hi-dhl 哈喽,1.1.8 提示了这个,是一定需要升级到 Java 11 吗?

使用1.1.5报错,改成1.1.8又出现了这个问题。

可以更新最新的版本, JDK的 问题已经修复了

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

4 participants