さわらブログ

さわら(@xhiroga)の技術ブログ

Expo製のReact Nativeアプリで Firebase を設定したはずなのに `Unhandled Rejection (Error): Firebase JS Analytics SDK is not available` → config の階層が間違っているかも?

TL;DR

誤り

    "web": {
      "favicon": "******",
      "config": {
          "apiKey": "******",
          "authDomain": "******",
          "projectId": "******",
          "storageBucket": "******",
          "messagingSenderId": "******",
          "appId": "******",
          "measurementId": "******"
      }
    },

正解

    "web": {
      "favicon": "******",
      "config": {
        "firebase": {
          "apiKey": "******",
          "authDomain": "******",
          "projectId": "******",
          "storageBucket": "******",
          "messagingSenderId": "******",
          "appId": "******",
          "measurementId": "******"
        }
      }
    },

config の内側に firebase という階層も必要でした。