2017-11-02 5 views
0

Google Cloud Speech 및 Firebase RealTime Database를 사용하는 프로젝트가 있고 프로젝트가 발전하면서 Google FireStore 기능을 추가하려고합니다. 하지만 종속성을 컴파일 한 후 런타임 오류가 발생했습니다.런타임시 오류가있는 Firebase Firestore 오류

Error:(458, 21) error: no suitable method found for 
intercept(GoogleCredentialsInterceptor) 
method zzbc.intercept(List<zzl>) is not applicable 
(argument mismatch; GoogleCredentialsInterceptor cannot be converted to List<zzl>) 
method zzbc.intercept(zzl...) is not applicable 
(varargs mismatch; GoogleCredentialsInterceptor cannot be converted to zzl) 
method AbstractManagedChannelImplBuilder.intercept(List<zzl>) is not applicable 
(argument mismatch; GoogleCredentialsInterceptor cannot be converted to List<zzl>) 
method AbstractManagedChannelImplBuilder.intercept(zzl...) is not applicable 
(varargs mismatch; GoogleCredentialsInterceptor cannot be converted to zzl) 

GCS에서 자격 증명을 얻으려고하면이 오류가 발생합니다.

.intercept(new GoogleCredentialsInterceptor(new GoogleCredentials(accessToken).createScoped(SCOPE)))

내 의존성 :

ext { 
    //FirebaseUI Version Firebase/Play Services Version 
    //  3.1.0     11.4.2 
    supportLibraryVersion = '27.0.0' 
    grpcVersion = '1.7.0' 
    googlePlayVersion = '11.4.2' 
    firebaseVersion = '11.4.2' 
    fireUIVersion = '3.1.0' 
    facebookVersion = '4.27.0' 
    glideVersion = '4.3.0' 
} 

    ... 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
compile "io.grpc:grpc-okhttp:$grpcVersion" 
compile "io.grpc:grpc-protobuf-lite:$grpcVersion" 
compile "io.grpc:grpc-stub:$grpcVersion" 
compile('com.google.auth:google-auth-library-oauth2-http:0.7.1') { 
    exclude module: 'httpclient' 
} 

// Support Libraries: 
compile "com.android.support:appcompat-v7:$supportLibraryVersion" 
compile "com.android.support:preference-v7:$supportLibraryVersion" 
compile "com.android.support:design:$supportLibraryVersion" 
compile "com.android.support:cardview-v7:$supportLibraryVersion" 
compile "com.android.support:preference-v7:$supportLibraryVersion" 
compile "com.google.android.gms:play-services-auth:$firebaseVersion" 

// FirebaseUI for Firebase Auth 

compile "com.google.android.gms:play-services-auth:$googlePlayVersion" 
compile "com.google.firebase:firebase-database:$firebaseVersion" 
compile "com.google.firebase:firebase-auth:$firebaseVersion" 
compile "com.google.firebase:firebase-core:$firebaseVersion" 
compile "com.google.firebase:firebase-firestore:$firebaseVersion" 

compile "com.android.support:recyclerview-v7:$supportLibraryVersion" 
compile "com.android.support:support-v4:$supportLibraryVersion" 

compile 'com.firebaseui:firebase-ui-auth:3.1.0' 
compile 'com.android.support.constraint:constraint-layout-solver:1.0.2' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'javax.annotation:javax.annotation-api:1.2' 

    apply plugin: 'com.google.gms.google-services' 

프로젝트 수준 :

buildscript { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.google.com' } 
     mavenLocal() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0' 
     classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3' 
     classpath 'com.android.tools.build:gradle:3.1.0-alpha01' 
     classpath 'com.google.gms:google-services:3.1.1' 
    } 


allprojects { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.google.com' } 
     maven { url "https://jitpack.io" } 
     maven { 
      url "http://dl.bintray.com/ahmedrizwan/maven" 
     } 
     maven { 
      url "http://dl.bintray.com/glomadrian/maven" 
     } 

     mavenCentral() 
    } 
} 

하면

@Override 
    protected void onPostExecute(AccessToken accessToken) { 
     mAccessTokenTask = null; 
     final ManagedChannel channel = new OkHttpChannelProvider() 
       .builderForAddress(HOSTNAME, PORT) 
       .nameResolverFactory(new DnsNameResolverProvider()) 
       .intercept(new GoogleCredentialsInterceptor(new GoogleCredentials(accessToken) 
         .createScoped(SCOPE))) 
       .build(); 
     mApi = SpeechGrpc.newStub(channel); 

     // Schedule access token refresh before it expires 
     if (mHandler != null) { 
      mHandler.postDelayed(mFetchAccessTokenRunnable, 
        Math.max(accessToken.getExpirationTime().getTime() 
          - System.currentTimeMillis() 
          - ACCESS_TOKEN_FETCH_MARGIN, ACCESS_TOKEN_EXPIRATION_TOLERANCE)); 
     } 
    } 
} 

코드는 코드의이 부분에서 충돌한다 나는 다음을 제거 :

 // TRYED WITH compile 'com.google.firebase:firebase-firestore:11.4.2' 
    compile 'com.firebaseui:firebase-ui-auth:3.1.0' 

모든 작품이 훌륭합니다! 하지만 Firestore 기능을 위해 필요합니다.

모든 API를 사용할 수 있으며 Google Cloud Data Storage가 사용 중지되었습니다.

Cloud Firestore and App Engine: You can't use both Cloud Firestore and Cloud Datastore in the same project, which might affect apps using App Engine. Try using Cloud Firestore with a different project.

+1

이것은 충돌의 원인이 아닐 수 있지만 firebase-ui-auth의 버전을 3.1.0으로 수정해야합니다. 11.4.2와 호환되는 버전입니다. [종속성 테이블] (https://github.com/firebase/FirebaseUI-Android#dependencies)을 참조하십시오. –

+0

3.1.0 용으로 업데이트되었지만 여전히 동일합니다. 팁에 대해 감사드립니다. –

답변

1

죄송이가 발생하고 있지만 여기에 대답으로 경우 FireStore는 외부 gRPC와 (현재) 호환되지 않습니다 :

Cloud Firestore with gRPC build error

11.8.0 릴리스는이 문제를 해결합니다.

관련 문제