NoClassDefFoundError: com/squareup/javapoet/TypeName when including library

NoClassDefFoundError: com/squareup/javapoet/TypeName when including library

我一直在开发一个基于注解处理器的库。当我 运行 它作为本地图书馆时,它工作正常。例如

implementation project(':dialogboot-annotations')
annotationProcessor project(':dialogboot-compiler')    

但是在将它发布到 jCenter 之后。它看起来像

implementation 'com.masum.dialogboot:dialogboot-annotations:1.1.1'
annotationProcessor 'com.masum.dialogboot:dialogboot-compiler:1.1.1'

但是当我使用这个 jCenter 存储库时,它会生成以下错误,但在本地它工作正常

Error:Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider dialogboot.compiler.DialogProcessor could not be instantiated: java.lang.NoClassDefFoundError: com/squareup/javapoet/TypeName

如果有人在 jCenter 中发布库后遇到同样的问题,请帮助我。

我通过更改 android-maven-gradle-plugin 版本 2.0 而不是根 [=18] 中的 1.1.4 解决了我的问题=]依赖项

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'