2017-12-27 172 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