2017-12-27 250 views
1

我有一个使用匕首-2和GRPC一个Java项目,当我尝试建立使用它./gradlew构建我得到以下错误:MoreTypes类未找到

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

被MoreTypes应该是提供内部的匕首-2依赖或我应该提供该类路径的依赖关系?

这是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 

回答

3

这是固定在2.14.1在匕首2.14的一个问题。见issue 994, “匕首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