2016-11-16 10 views
0

Google SigninでFirebaseを使用してユーザーをAndroidアプリに認証しています。このアプリはうまくいきましたが、私はUbuntuとAndroid Studioを再インストールしました。今はもっと働いていません。私は(グーグルのメールアドレスとパスワードを使用して)で、Googleのログインと認証用メールアドレスとパスワードを入れてFirebase Android AppでGoogle Sign Inが失敗しました - GoogleSignInResult @ a84236f

、が返さエラーは、TIS値が返されたと呼ばれる GoogleSignInResult @ a84236f関数であった:

onActivityResult(int型requestCode、int型のresultCode、テントデータ)

は、このコードはどういう意味: GoogleSignInResult @ a84236f?

となり、result.isSuccess() の結果は、となります。

機能を完全には、次のとおりです。失敗した

@Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
     super.onActivityResult(requestCode, resultCode, data); 

     // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...); 
     Log.d("DEIP","request code = 9001? ="+requestCode); 
     if (requestCode == RC_SIGN_IN) { 
      GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); 
      Log.d(TAG," isSucess? result.toString ="+result.toString()); 
      Log.d(TAG," +result.isSuccess() ="+result.isSuccess()); 
      if (result.isSuccess()) { 
       // Google Sign In was successful, authenticate with Firebase 
       GoogleSignInAccount account = result.getSignInAccount(); 
       firebaseAuthWithGoogle(account); 
      } else { 
       // Google Sign In failed 
       Log.e(TAG, "Google Sign In failed."); 
       Log.d(TAG,"Failed into onActivityResult"); 
      } 
     } 
    } 

結果は次のとおりです。

isSucess? result.toString =com.google.android.gms.auth.api.signin**[email protected]**:+ result.isSuccessは()

偽もう一つ、私はコマンド のkeytoolを入れ指紋を= -exportcert -list -v -alias androiddebugkey -keystore〜/ .android/debug.keystore

は私にSHA1フィンガープリントを与えるが、私はFirebaseコンソール指紋にこの値を入れて、firebase.console.google.comサイトは、SHA256のように認識します。

この問題は上記の問題と関連している可能性がありますか?どうすれば修正できますか?

私が試した:

  1. を再SHA1フィンガープリントを生成します。 - Firebaseは私のsh1の指紋が256の指紋であるという情報を与える。リリースキーとデバッグキーも生成しました。

  2. 新しいファイルgoogle-services.jsonをAndroid Studioのアプリディレクトリに配置しました。

  3. 私は実際の携帯電話にアプリを実行しようとしましたが、エラーは仮想の携帯電話と同じでした。

  4. パッケージ名をAndroidManifes.xmlファイルに、このフィールドをFirebaseコンソールに比較します。

  5. プロジェクトをクリーンアップして再構築します。

  6. 無効にインスタント実行

  7. 私は依存関係(9.8の新しい値を入れます。0)コンパイルたい'com.google.firebase:firebase-auth:9.8.0'

    依存関係{ fileTree(DIRコンパイル: 'LIBS' が含まれる:[ '*の.jar']) testCompile 'のJUnit:JUnitの:4.12'

    compile 'com.android.support:design:24.0.0' 
    compile 'com.github.bumptech.glide:glide:3.6.1' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    compile 'com.android.support:appcompat-v7:24.0.0' 
    
    // Google 
    compile 'com.google.android.gms:play-services-auth:9.8.0' 
    
    // Firebase 
    compile 'com.google.firebase:firebase-database:9.8.0' 
    compile 'com.google.firebase:firebase-auth:9.8.0' 
    compile 'com.google.firebase:firebase-config:9.8.0' 
    compile 'com.google.android.gms:play-services-appinvite:9.8.0' 
    compile 'com.google.firebase:firebase-messaging:9.8.0' 
    compile 'com.google.android.gms:play-services-ads:9.8.0' 
    compile 'com.google.firebase:firebase-crash:9.8.0' 
    compile 'com.google.firebase:firebase-analytics:9.8.0' 
    // Firebase UI 
    compile 'com.firebaseui:firebase-ui-database:0.4.0' 
    
    // Testing dependencies 
    androidTestCompile 'junit:junit:4.12' 
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2' 
    androidTestCompile 'com.android.support.test:runner:0.5' 
    androidTestCompile 'com.android.support:support-annotations:24.0.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta3' 
    
    //tryning to make COntrainlayout work 
        //compile 'android.support.constraint.ConstraintLayout' 
    // 
    
    compile 'com.google.firebase:firebase-core:9.8.0' 
    

    を}

    プラグインを適用する:「com.google.gms.google-サービスの プラグインを適用する: 'com.android.application'

答えて

0

エラーでした私が指紋を作成した方法。 コマンド

keytool -exportcert -list -v \ 
-alias androiddebugkey -keystore ~/.android/debug.keystore 

私には役に立たなかった。 " [基本的にはAndroidスタジオの右端にある[Gradle]メニューを開き、ドロップダウンからアンドロイドを開き(何も表示されていない場合は更新)、[タスクを開く]、[アンドロイドを開く] 、ダブルクリックsigningReportこのリンクに示す :。 https://github.com/firebase/friendlychat/issues/11

またはこのビデオチュートリアル [https://www.youtube.com/watch?v=m_9tk7ME4ZU][2]

Firebaseチームは、このエラーで私を助けました。

0

は、私は同じ問題を抱えていると私はそれはそれは、この段階では、この問題を解決すると述べ

this tutorialをしようとしている:あなたのリリースキーストアのSHA1と

  1. 更新Firebaseコンソール。
  2. google-config.jsonファイルを再ダウンロードします。
  3. リリースキーストアをグラデルファイルと同じフォルダに置き、gradleを以下のコードで更新します。
関連する問題