使用JAR文件的Gradle的Annotation Processor依赖性

发布于 2025-02-10 02:08:23 字数 770 浏览 2 评论 0原文

我正在将匕首整合到我的项目中,并且遇到了这个问题。

我想添加jar依赖项,而不是像

`annotationProcessor "com.google.dagger:dagger-compiler:2.41"`

下面的

entotationProcessor文件('libs/dagger-compiler-2.41.jar'),但是当我编译时,它会使我的错误

执行失败''。

匕首/spi/shaded/androidx/room/compiler/processing/javac/javacbasicantationProcessor 引起:java.lang.noclassdeffounderror:匕首/spi/shaded/androidx/room/compiler/compiler/processing/javac/javacbasicantationProcesso

:当我使用AnnoTationProcessor时,“ com.google.google.dagger:匕首 - 编译器:2.41”一切正常。

implementation files('libs/javax.inject-1.jar')
implementation files('libs/dagger-2.41.jar')
implementation files('libs/dagger-producers-2.41.jar')

I am integrating dagger in my project and I am having this issue.

I want to add jar dependencies instead of

`annotationProcessor "com.google.dagger:dagger-compiler:2.41"`

like below

annotationProcessor files('libs/dagger-compiler-2.41.jar') but when I compile, it gives me error

Execution failed for task ''.

dagger/spi/shaded/androidx/room/compiler/processing/javac/JavacBasicAnnotationProcessor
Caused by: java.lang.NoClassDefFoundError: dagger/spi/shaded/androidx/room/compiler/processing/javac/JavacBasicAnnotationProcesso

It is working with other jar daggger dependency but not with AnnotationProcessor. When I use annotationProcessor "com.google.dagger:dagger-compiler:2.41" everything works fine.

implementation files('libs/javax.inject-1.jar')
implementation files('libs/dagger-2.41.jar')
implementation files('libs/dagger-producers-2.41.jar')

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小清晰的声音 2025-02-17 02:08:23

经过大量的研究和命中和试验以及大量尝试,我能够将达格格(Daggger)与我在Gradle和Android MK中的项目集成在一起。

对于gradle:在API 28和30工作

//Dagger Dependencies
annotationProcessor files('libs/dagger-compiler-2.42.jar')
implementation files('libs/dagger-2.42.jar')
annotationProcessor files('libs/dagger-2.42.jar')
annotationProcessor files('libs/jsr305-3.0.2.jar')
annotationProcessor files('libs/dagger-producers-2.42.jar')
annotationProcessor files('libs/dagger-spi-2.42.jar')
annotationProcessor files('libs/google-java-format-1.5.jar')
annotationProcessor files('libs/failureaccess-1.0.1.jar')
annotationProcessor files('libs/guava-31.0.1-jre.jar')
annotationProcessor files('libs/javapoet-1.13.0.jar')
implementation files('libs/javax.inject-1.jar')
annotationProcessor files('libs/javax.inject-1.jar')
annotationProcessor files('libs/incap-0.2.jar')
annotationProcessor files('libs/checker-compat-qual-2.5.5.jar')
annotationProcessor files('libs/kotlin-stdlib-1.6.10.jar')
annotationProcessor files('libs/kotlin-stdlib-jdk8-1.5.32.jar')
annotationProcessor files('libs/kotlinx-metadata-jvm-0.4.2.jar')

After so much of research and hit and trial and lot of trying I was able to integrate daggger to my Project in gradle as well as in android MK.

For Gradle : Worked for both API 28 and 30

//Dagger Dependencies
annotationProcessor files('libs/dagger-compiler-2.42.jar')
implementation files('libs/dagger-2.42.jar')
annotationProcessor files('libs/dagger-2.42.jar')
annotationProcessor files('libs/jsr305-3.0.2.jar')
annotationProcessor files('libs/dagger-producers-2.42.jar')
annotationProcessor files('libs/dagger-spi-2.42.jar')
annotationProcessor files('libs/google-java-format-1.5.jar')
annotationProcessor files('libs/failureaccess-1.0.1.jar')
annotationProcessor files('libs/guava-31.0.1-jre.jar')
annotationProcessor files('libs/javapoet-1.13.0.jar')
implementation files('libs/javax.inject-1.jar')
annotationProcessor files('libs/javax.inject-1.jar')
annotationProcessor files('libs/incap-0.2.jar')
annotationProcessor files('libs/checker-compat-qual-2.5.5.jar')
annotationProcessor files('libs/kotlin-stdlib-1.6.10.jar')
annotationProcessor files('libs/kotlin-stdlib-jdk8-1.5.32.jar')
annotationProcessor files('libs/kotlinx-metadata-jvm-0.4.2.jar')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文