Meituan-Dianping / walle

Android Signature V2 Scheme签名下的新一代渠道包打包神器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradle 7注解@Input失效导致无法打包

MortalKim opened this issue · comments

参照Gradle7的文档中的描述,需要替换注解:

Incorrect use of the @Input annotation
This error indicates that a property is annotated with @Input, but that it should be annotated with @InputFile or @InputDirectory instead.

If you use the @Input annotation on a file-based property, Gradle wouldn’t consider the file contents, or the directory contents, as inputs, as you might expect.

To fix this problem, you need to tell Gradle if the file property represents an input file, in which case you should annotate it with @InputFile, or a directory, in which case it should be annotated with @InputDirectory. If what you really wanted to say is that the actual file path is an input, then you should return a String instead which corresponds to the absolute path of the file.

如果打包的话会报如下错误

* What went wrong:
Some problems were found with the configuration of task ':app:assembleReleaseChannels' (type 'ChannelMaker').
  - Type 'com.meituan.android.walle.ChannelMaker' field 'targetProject' without corresponding getter has been annotated with @Input.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'targetProject'.
      2. Remove the annotations on 'targetProject'.

    Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.
  - Type 'com.meituan.android.walle.ChannelMaker' field 'variant' without corresponding getter has been annotated with @Input.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:
      1. Add a getter for field 'variant'.
      2. Remove the annotations on 'variant'.

    Please refer to https://docs.gradle.org/7.0.2/userguide/validation_problems.html#ignored_annotations_on_field for more details about this problem.

希望能尽快修复,谢谢

commented

怎么解决的

怎么解决的

并没有解决,只能回退到6.9了,或者自己fork一个把这几个不兼容的注解改一下,谷歌给了方案,就在错误日志的链接里

给他们提了个PR,我本地改动walle后测了下没发现问题。#368

给他们提了个PR,我本地改动walle后测了下没发现问题。#368

非常感谢,哈哈哈这事是我懒了,提了之后没管它。
非常感谢大佬的工作~祝生活愉快

+1,要兼容gradle7了

官方快点升级呀~~~!!!

啥时候会升级啊

催更

commented

这个啥时候能适配

催更 都2022年了

commented

给他们提了个PR,我本地改动walle后测了下没发现问题。#368

大佬。有什么办法使用本地吗?

日常催更啊,美团大哥快点啊

commented

2年没更新了,已经不维护了吧

已经转用Google 官方的Flavor了,可以实现walle的分渠道功能,也用不了几行代码

commented

官方的Flavro有个缺点是每打一个渠道包要重新编译。不太好配合使用热更新。

类似walle的插件有腾讯的VasDolly。还在维护中。

这个库已经两年没维护了,我fork了一份新的,已适配agp7.x, 详见:https://github.com/Petterpx/walle

这个库已经两年没维护了,我fork了一份新的,已适配agp7.x, 详见:https://github.com/Petterpx/walle

能否适配一下谷歌商店的aab格式? @Petterpx

这个库已经两年没维护了,我fork了一份新的,已适配agp7.x, 详见:https://github.com/Petterpx/walle

能否适配一下谷歌商店的aab格式? @Petterpx

短时间内应该不能,适配7.x比较简单。aab的话,还没有看过walle具体的源码,可以关注一下等等我后续适配。
其他方式上,对于googleplay,我们目前是单独对应了一个分支(有些组件googleplay不允许存在),所以你可以将渠道写死在本地逻辑里即可。 @scsfwgy

commented

这个库已经两年没维护了,我fork了一份新的,已适配agp7.x, 详见:https://github.com/Petterpx/walle

jitpack库我添加了, 但是根据你的依赖同步不了

这个库已经两年没维护了,我fork了一份新的,已适配agp7.x, 详见:https://github.com/Petterpx/walle

jitpack库我添加了, 但是根据你的依赖同步不了

jitpack 官方出现问题导致,等待即可。