gpt4 book ai didi

java - 找不到MoreTypes类

转载 作者:行者123 更新时间:2023-12-03 03:40:00 25 4
gpt4 key购买 nike

我有一个使用dagger-2和grpc的Java项目,当我尝试使用./gradlew build进行构建时,出现以下错误:

> java.lang.NoClassDefFoundError: com/google/auto/common/MoreTypes

应该在Dagger-2依赖项中提供MoreTypes还是在类路径上提供该依赖项?

这是gradle.build文件内容的相关部分:
plugins {
id "net.ltgt.apt" version "0.10"
id "com.google.protobuf" version "0.8.1"
id "java"
}

dependencies {
compile 'io.grpc:grpc-all:1.5.0'

compile 'com.google.dagger:dagger:2.14'
apt 'com.google.dagger:dagger-compiler:2.14'

testApt 'com.google.dagger:dagger-compiler:2.14'

}



apply plugin: 'java'

sourceCompatibility = 1.8
targetCompatibility = 1.8

最佳答案

这是2.14.1中修复的Dagger 2.14中的问题。参见issue 994,“ Dagger 2.14中断构建”:

I have not isolated the issue to a small sample project at this point, but a possible cause I see is below, maybe that gives a pointer. I don't have any explicit dependency on Google Auto libs in that part of the build.

java.lang.NoClassDefFoundError: com/google/auto/common/MoreTypes

确认已在2.14.1中修复,其中包含 this commit

关于java - 找不到MoreTypes类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47991583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com