kanyun-inc / Kace

Kace: Kotlin Android Compatible Extensions, a framework for assisting in the seamless migration from kotlin-android-extensions
Apache License 2.0
261 stars 11 forks source link

Support Generic View Type #24

Closed bennyhuo closed 1 year ago

bennyhuo commented 1 year ago

Generated files from layout contains generic view type cannot compile.

image

The type of pickerView is UIKitOptionsExtPickerView<T>.

Consider generating Java source code to avoid the generic arguments by taking advance of the Java raw type.

jarvan11 commented 1 year ago

企业微信截图_1691995248830 Error:One type argument expected for class BannerViewPager<T : Any!> 泛型报错,不支持这种么?

RicardoJiang commented 1 year ago

企业微信截图_1691995248830 Error:One type argument expected for class BannerViewPager<T : Any!> 泛型报错,不支持这种么?

是的,还不支持泛型类型,可以先把这种 layout 加入 blackList 不生成代码,这部分 layout 手动迁移到 findViewById 或者 ViewBinding

bennyhuo commented 1 year ago

试一下 1.8.20-1.2.0-SNAPSHOT。

jarvan11 commented 1 year ago

1.8.20-1.2.0-SNAPSHOT @bennyhuo Could not find com.kanyun.kace:kace-gradle-plugin:1.8.20-1.2.0-SNAPSHOT. 企业微信截图_16922444726469

RicardoJiang commented 1 year ago

1.8.20-1.2.0-SNAPSHOT @bennyhuo Could not find com.kanyun.kace:kace-gradle-plugin:1.8.20-1.2.0-SNAPSHOT. 企业微信截图_16922444726469

snapshot 依赖需要添加如下 maven 仓库地址: maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots" }

jarvan11 commented 1 year ago

1.8.20-1.2.0-SNAPSHOT @bennyhuo @RicardoJiang 加了也不行,没看到1.8.20-1.2.0相关的。 https://s01.oss.sonatype.org/content/repositories/snapshots/com/kanyun/kace/kace-gradle-plugin/ 企业微信截图_16922511704975

RicardoKanYun commented 1 year ago

1.8.20-1.2.0-SNAPSHOT @bennyhuo @RicardoJiang 加了也不行,没看到1.8.20-1.2.0相关的。 https://s01.oss.sonatype.org/content/repositories/snapshots/com/kanyun/kace/kace-gradle-plugin/ 企业微信截图_16922511704975

现在好了,再看看

jarvan11 commented 1 year ago

企业微信截图_1691995248830 Error:One type argument expected for class BannerViewPager<T : Any!> 泛型报错,不支持这种么?

@bennyhuo @RicardoKanYun 接入1.8.20-1.2.0-SNAPSHOT,还有这个地方的泛型报错, error:One type argument expected for class BannerViewPager<T : Any!> 企业微信截图_16922569385241

bennyhuo commented 1 year ago

稍等,我 Fix 一下

bennyhuo commented 1 year ago

已经更新,再编译一下试试,版本号不变

jarvan11 commented 1 year ago

已经更新,再编译一下试试,版本号不变

@bennyhuo 更新编译了,还是不行 企业微信截图_16922616352552 附BannerViewPager三方库类: 企业微信截图_16922616994408

bennyhuo commented 1 year ago

看样子你没有拉到最新的包,编译生成的代码应该是这样:

image

KaceViewUtils 是这次提交新加的

jarvan11 commented 1 year ago

看样子你没有拉到最新的包,编译生成的代码应该是这样:

image

KaceViewUtils 是这次提交新加的

嗯,可以了,SNAPSHOT版本不能实时更新问题,设置下SNAPSHOT依赖gradle默认缓存时间就好了。 但是KaceViewUtils没找到(Unresolved reference: KaceViewUtils)? 企业微信截图_16922631916644

bennyhuo commented 1 year ago

kace-runtime 也需要清一下缓存的

bennyhuo commented 1 year ago

没有问题的话我准备直接发正式版了。有问题可以随时把 issue 打开。