gRPC 및 Firestore를 사용해야하는 Android 애플리케이션에서 작업하고 있습니다. 그러나 'io.grpc'그룹 종속성 (예 : io.grpc : grpc-okhttp : 1.7.0)과 firestore 종속성 (com.google.firebase : firebase-firestore : 11.4.2)의 모듈을 모두 추가 할 때 build gradle config, "dex를 병합 할 수 없습니다"라는 빌드 오류가 발생했습니다. '스택 트레이스'옵션을 빌드 후, 나는 문제가 경우 FireStore가 grpc 코어 모듈을 사용하는 경우gRPC 빌드 오류가있는 Cloud Firestore
Multiple dex files define Lio/grpc/internal/OobChannel$5;
그것은 일어날 수 있음을 보았다,하지만 난 [androidDependencies] Gradle을을 사용하여 얻었다 트리 종속성 유사한 아무도, 없다 태스크. 나는 io.grpc를 다음과 같이 제외하려고 시도했다 :
implementation ('com.google.firebase:firebase-firestore:11.4.2') {
exclude group: 'io.grpc'
}
그러나 같은 오류가 있었다. 그렇다면 grpc 모듈 종속성에서 모든 'io.grpc.'전이 종속성을 내부 클래스에 grpc-core를 추가하는 것으로 제외하면 어떻게 될지 생각했습니다. 이러한 방법으로, 난 그냥 시험 추한 종속성을 썼다
implementation 'com.google.firebase:firebase-firestore:11.4.2'
implementation('io.grpc:grpc-okhttp:1.7.0') {
exclude group: 'io.grpc'
}
implementation('io.grpc:grpc-protobuf-lite:1.7.0') {
exclude group: 'io.grpc'
}
implementation('io.grpc:grpc-stub:1.7.0') {
exclude group: 'io.grpc'
}
implementation 'io.grpc:grpc-core:1.7.0'
가 성공적으로 컴파일 할 때 나는 깜짝 놀랐다 있지만, 앱 실행 후, 그것은 java.lang.RuntimeException가 함께 추락 : 내부 오류를 경우 FireStore (에서 0.6.6-DEV)
Caused by: java.lang.NoSuchMethodError: No static method zzcyc()Lio/grpc/ManagedChannelProvider; in class Lio/grpc/ManagedChannelProvider; or its super classes (declaration of 'io.grpc.ManagedChannelProvider' appears in /data/app/com.zipr.test-2/split_lib_dependencies_apk.apk)
나는 multidex 지원을 활성화하면서 gradle 3.0.0-rc1을 사용합니다. .gradle을 삭제하고, 디렉토리를 만들고, 다시 빌드 된 프로젝트를 정리했지만 빌드 오류가 발생했습니다. 이 문제를 해결하려면 어떻게해야합니까?
빠른 답변 감사드립니다.이 문제가 해결되기를 바랍니다. –