2016-08-31 4 views
2
私はGoogleの-services.jsonファイルを配置するために、Androidのプロジェクトでfirebaseデータベースを使用しています

に異なるproductFlavorsをGoogle-services.jsonを追加します。はどのように、私は</p> <p><a href="https://developers.google.com/android/guides/google-services-plugin" rel="nofollow">this</a>を以下ですが、私は次のエラーを取得していますアンドロイドスタジオ

File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it 

開発用とテスト環境用の2つのフォルダを作成しました。私はそれぞれに2つの異なるデータベースを持っています。ですから、2つの異なるgoogle-services.jsonファイルが必要です。 これらのファイルを置く場所を教えてください。 ありがとうございます。

+0

このhttps://support.google.com/firebase/answer/7015592を参照してくださいを使用することができます。 – Abbas

+0

デバッグビルドとリリースビルドのパッケージ名は同じですか?なぜ別のjsonが必要なのですか?パッケージ名が異なる場合、そのパッケージ名でjsonにクライアントをもう1つ追加する必要がありますが、jsonは1つしかありません。 –

+0

はい私は同じパッケージ名を持っていますが、別のFirebaseデータベースを参照しています。 –

答えて

1

次のようなJSON配列

{ 
    "project_info": { 
    "project_id": "quickblox.com:api-project-761750217637", 
    "project_number": "761750217637", 
    "name": "QuickBlox Android samples" 
    }, 

    "client": [ 
    { 
     "client_info": { 
     "mobilesdk_app_id": "1:761750217637:android:c4299bc46191b0d7", 
     "client_id": "android:com.quickblox.sample.groupchatwebrtc", 
     "client_type": 1, 
     "android_client_info": { 
      "package_name": "com.quickblox.sample.groupchatwebrtc" 
     } 
     }, 
     "oauth_client": [], 
     "api_key": [], 
     "services": { 
     "analytics_service": { 
      "status": 1 
     }, 
     "cloud_messaging_service": { 
      "status": 2, 
      "apns_config": [] 
     }, 
     "appinvite_service": { 
      "status": 1, 
      "other_platform_oauth_client": [] 
     }, 
     "google_signin_service": { 
      "status": 1 
     }, 
     "ads_service": { 
      "status": 1 
     } 
     } 
    }, 
    { 
     "client_info": { 
     "mobilesdk_app_id": "1:761750217637:android:f7ceaf9593b66d36", 
     "client_id": "android:com.quickblox.simplesample.messages", 
     "client_type": 1, 
     "android_client_info": { 
      "package_name": "com.quickblox.simplesample.messages" 
     } 
     }, 
     "oauth_client": [], 
     "api_key": [], 
     "services": { 
     "analytics_service": { 
      "status": 1 
     }, 
     "cloud_messaging_service": { 
      "status": 2, 
      "apns_config": [] 
     }, 
     "appinvite_service": { 
      "status": 1, 
      "other_platform_oauth_client": [] 
     }, 
     "google_signin_service": { 
      "status": 1 
     }, 
     "ads_service": { 
      "status": 1 
     } 
     } 
    }, 
    { 
     "client_info": { 
     "mobilesdk_app_id": "1:761750217637:android:d150eafea3b1427e", 
     "client_id": "android:com.quickblox.sample.chat", 
     "client_type": 1, 
     "android_client_info": { 
      "package_name": "com.quickblox.sample.chat" 
     } 
     }, 
     "oauth_client": [], 
     "api_key": [], 
     "services": { 
     "analytics_service": { 
      "status": 1 
     }, 
     "cloud_messaging_service": { 
      "status": 2, 
      "apns_config": [] 
     }, 
     "appinvite_service": { 
      "status": 1, 
      "other_platform_oauth_client": [] 
     }, 
     "google_signin_service": { 
      "status": 1 
     }, 
     "ads_service": { 
      "status": 1 
     } 
     } 
    } 
    ], 
    "client_info": [], 
    "ARTIFACT_VERSION": "1" 
} 
関連する問題

 関連する問題