2016-11-26 1 views
0

netty로 Google protobuf를 설치하려고합니다.하지만 편집을 시작할 때 (적어도 첫 번째 시도에서) Google의 protobuf를 다운로드하면 컴파일이 시작됩니다.Gradle이 Google Protobuf 패키지를 찾지 못했습니다.

여기
/src/main/java/GameMoveOuterClass.java:1536: error: package com.google.protobuf.GeneratedMessageV3 does not exist 
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 

내 build.gradle이다 : 누군가가 잘못 알고있는 경우

apply plugin: 'java' 
apply plugin: 'com.google.protobuf' 

repositories { 
    mavenCentral() 
} 

buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.0' 
    } 
} 

dependencies { 
    compile group: 'io.netty', name: 'netty-all', version: '4.1.5.Final' 
    compile group: 'com.google.protobuf', name: 'protobuf-java', version: '2.4.1' 
} 


jar { 
    manifest { 
     attributes("Main-Class": 'server.Server', 
     "Class-Path": configurations.compile.collect { it.getPath() }.join(' ')) 
    } 
} 

은 나를 감사 제를 사용

답변

0

을 알려 주시기 바랍니다 e maven central advanced searchcom.google.protobuf.GeneratedMessageV3의 경우 해당 클래스는 com.google.cloud:google-cloud-nio:xxx 또는 아마도 com.trueaccord.scalapb:protobuf-runtime-scala_yyy:zzz 인 것으로 보입니다. 클래스 패스에이 중 하나를 추가해야한다고 생각합니다.

0

저는 Gradle에 익숙하지 않지만, 새로운 protobuf 생성 코드를 지원하지 않는 오래된 protobuf 라이브러리와 혼합하는 것처럼 보입니다. GeneratedMessageV3 클래스는 최근에 추가되었으므로 (3.0 정도는 믿을 만 함)이 클래스를 참조하는 새로운 생성 코드는이를 포함하지 않는 이전 라이브러리와 연결할 수 없습니다.

0

GeneratedMessageV3과 함께 제공되지 않는 protobuf 버전 2.4.1을 사용 중입니다. 3.0.0

dependencies { 
    compile group: 'io.netty', name: 'netty-all', version: '4.1.5.Final' 
    compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.0.0' 
} 
같은이 클래스를 포함 protobuf의 새로운 버전으로

업데이트

관련 문제