Skip to content

[πŸ›] πŸ”₯ Secondary applications remote config will fallback to [DEFAULT] application on androidΒ #8729

@rsouthgate

Description

@rsouthgate

Issue

When creating a secondary app with a different projectId to the [DEFAULT] configuration defined within the google-services.json file and initialized natively when requesting the secondary app's remote config the values for the [DEFAULT] app will be returned. This issue does not occur on ios where the GoogleService-Info.plist doesn't even have a projectId defined and so the native code must be relying on the secondary app definition for projectId and so retrieves the correct remote config.

Note. I've found this issue in remote configuration module but it may be more widespread that just that module if other modules use a similar mechanism. However the auth module does behave correctly and authenticates against users in the apps associated project so it seems not all modules use the same mecahnism for projectId.


Project Files

This is an Expo managed project so I don't have any native configuration files

Javascript

Click To Expand

package.json:

{
  "name": "@mycompany/myproject",
  "version": "1.0.0",
  "license": "MIT",
  "private": true,
  "engines": {
  "node": ">=24.3.0 <25.0.0",
  "npm": ">=11.0.0 <12.0.0"
  },
  "scripts": 
  {
    ...
  },
  "devDependencies": {
    "@babel/core": "^7.14.5",
    "@babel/plugin-transform-flow-strip-types": "^7.14.5",
    "@babel/plugin-transform-react-jsx-self": "^7.27.1",
    "@babel/plugin-transform-react-jsx-source": "^7.27.1",
    "@babel/preset-react": "^7.14.5",
    "@babel/preset-typescript": "^7.14.5",
    "@emotion/babel-plugin": "^11.13.5",
    "@eslint/js": "^9.8.0",
    "@expo/build-tools": "1.0.181",
    "@expo/cli": "0.24.20",
    "@expo/config-plugins": "~10.0.0",
    "@expo/devcert": "^1.2.0",
    "@expo/metro-config": "^0.20.14",
    "@expo/prebuild-config": "~9.0.0",
    "@expo/repack-app": "0.2.10",
    "@nx/devkit": "21.1.2",
    "@nx/eslint": "21.1.2",
    "@nx/eslint-plugin": "21.1.2",
    "@nx/expo": "21.1.2",
    "@nx/jest": "21.1.2",
    "@nx/js": "21.1.2",
    "@nx/key": "^3.0.0",
    "@nx/playwright": "21.1.2",
    "@nx/plugin": "^21.1.2",
    "@nx/react": "21.1.2",
    "@nx/react-native": "21.1.2",
    "@nx/rollup": "21.1.2",
    "@nx/storybook": "^21.1.2",
    "@nx/vite": "21.1.2",
    "@nx/web": "21.1.2",
    "@nx/workspace": "21.1.2",
    "@playwright/test": "^1.36.0",
    "@react-native-community/cli": "^18.0.0",
    "@react-native/metro-babel-transformer": "~0.79.0",
    "@rollup/plugin-url": "^8.0.2",
    "@storybook/addon-a11y": "^9.1.6",
    "@storybook/addon-coverage": "^2.0.0",
    "@storybook/addon-docs": "^9.1.6",
    "@storybook/addon-react-native-web": "^0.0.29",
    "@storybook/addon-vitest": "^9.1.10",
    "@storybook/jest": "^0.2.3",
    "@storybook/react-vite": "9.1.7",
    "@storybook/test-runner": "^0.23.0",
    "@storybook/testing-library": "^0.2.2",
    "@svgr/rollup": "^8.1.0",
    "@swc-node/register": "~1.10.10",
    "@swc/cli": "~0.7.8",
    "@swc/core": "~1.13.5",
    "@swc/helpers": "~0.5.17",
    "@testing-library/dom": "^10.4.0",
    "@testing-library/jest-dom": "~6.6.3",
    "@testing-library/jest-native": "~5.4.3",
    "@testing-library/react": "16.3.0",
    "@testing-library/react-native": "13.2.0",
    "@types/jest": "^29.5.14",
    "@types/luxon": "^3.6.2",
    "@types/node": "22.15.14",
    "@types/react": "~19.0.10",
    "@types/react-dom": "19.0.0",
    "@vitejs/plugin-react": "^4.2.0",
    "@vitest/browser": "^3.2.4",
    "@vitest/coverage-istanbul": "^3.2.4",
    "@vitest/ui": "^3.2.4",
    "axe-core": "^4.10.3",
    "babel-jest": "^29.7.0",
    "babel-plugin-dynamic-import-node": "^2.3.3",
    "babel-plugin-import-directory": "^1.1.0",
    "babel-plugin-istanbul": "^7.0.0",
    "babel-plugin-macros": "^3.1.0",
    "babel-preset-expo": "~13.0.0",
    "core-js": "^3.41.0",
    "crmux": "^0.0.9",
    "diff": "^8.0.2",
    "eas-cli": "^16.15.0",
    "eas-cli-local-build-plugin": "1.0.190",
    "eslint": "^8.57.0",
    "eslint-config-expo": "~9.2.0",
    "eslint-config-google": "^0.14.0",
    "eslint-config-prettier": "^10.0.0",
    "eslint-plugin-import": "2.31.0",
    "eslint-plugin-jsx-a11y": "6.10.2",
    "eslint-plugin-playwright": "~2.2.0",
    "eslint-plugin-react": "7.37.0",
    "eslint-plugin-react-hooks": "5.2.0",
    "eslint-plugin-storybook": "9.1.7",
    "expo-module-scripts": "4.1.9",
    "fastlane": "^0.0.9",
    "firebase-admin": "13.4.0",
    "firebase-tools": "14.5.1",
    "http-server": "^14.1.1",
    "jest": "^29.7.0",
    "jest-circus": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "jest-environment-node": "^29.7.0",
    "jest-expo": "^53.0.7",
    "jiti": "2.4.2",
    "jsdom": "~26.0.0",
    "jsonc-eslint-parser": "^2.1.0",
    "metro": "^0.82.3",
    "metro-config": "^0.82.3",
    "metro-react-native-babel-preset": "^0.77.0",
    "metro-resolver": "^0.82.3",
    "nx": "^21.1.2",
    "nyc": "^17.1.0",
    "patch-package": "^8.0.1",
    "postinstall-postinstall": "^2.1.0",
    "prettier": "~3.5.3",
    "puppeteer": "^24.9.0",
    "react-native-testing-library": "^2.2.0",
    "react-test-renderer": "19.0.0",
    "rollup": "^4.14.0",
    "sass": "^1.55.0",
    "storybook": "^9.1.7",
    "storybook-addon-deep-controls": "^0.9.5",
    "ts-jest": "^29.1.0",
    "ts-node": "10.9.1",
    "tslib": "^2.3.0",
    "typescript": "~5.8.3",
    "typescript-eslint": "^8.19.0",
    "vite": "^6.3.5",
    "vite-plugin-babel": "^1.3.2",
    "vite-plugin-dts": "~4.5.0",
    "vite-plugin-rnw": "~0.0.7",
    "vitest": "^3.2.4",
    "yaml": "^2.8.1"
  },
  "dependencies": {
    "@apollo/client": "3.13.8",
    "@azure/identity": "^4.11.1",
    "@azure/monitor-ingestion": "^1.2.0",
    "@craftzdog/react-native-buffer": "^6.1.1",
    "@emotion/native": "^11.11.0",
    "@emotion/react": "^11.14.0",
    "@emotion/styled": "^11.14.1",
    "@expo/metro-runtime": "5.0.4",
    "@hookform/resolvers": "^5.1.1",
    "@microsoft/applicationinsights-react-native": "^4.3.7",
    "@microsoft/applicationinsights-web": "^3.3.9",
    "@nx/devkit": "21.1.2",
    "@react-native-async-storage/async-storage": "2.1.2",
    "@react-native-firebase/analytics": "^22.2.1",
    "@react-native-firebase/app": "22.2.1",
    "@react-native-firebase/auth": "22.2.1",
    "@react-native-firebase/crashlytics": "22.2.1",
    "@react-native-firebase/installations": "22.2.1",
    "@react-native-firebase/remote-config": "22.2.1",
    "@react-native-masked-view/masked-view": "0.3.2",
    "@react-navigation/drawer": "^7.3.9",
    "@react-navigation/native": "^7.1.6",
    "@react-navigation/native-stack": "^7.3.27",
    "@reduxjs/toolkit": "^2.6.1",
    "@shopify/react-native-skia": "v2.0.0-next.4",
    "@tanstack/react-query": "^5.85.5",
    "es-toolkit": "^1.39.5",
    "expo": "~53.0.23",
    "expo-application": "^6.1.5",
    "expo-asset": "~11.1.7",
    "expo-auth-session": "~6.2.0",
    "expo-blur": "~14.1.5",
    "expo-build-properties": "~0.14.6",
    "expo-clipboard": "~7.1.5",
    "expo-constants": "~17.1.5",
    "expo-dev-client": "~5.2.0",
    "expo-device": "^7.1.4",
    "expo-font": "~13.3.1",
    "expo-linear-gradient": "~14.1.5",
    "expo-linking": "~7.1.7",
    "expo-notifications": "^0.31.3",
    "expo-random": "^14.0.1",
    "expo-router": "~5.1.0",
    "expo-secure-store": "~14.2.3",
    "expo-splash-screen": "~0.30.9",
    "expo-status-bar": "~2.2.3",
    "expo-updates": "~0.28.17",
    "expo-web-browser": "~14.1.6",
    "firebase": "^11.7.1",
    "graphql": "^16.11.0",
    "jotai": "^2.12.5",
    "luxon": "^3.7.1",
    "mockdate": "^3.0.5",
    "phosphor-react-native": "^2.3.1",
    "react": "19.0.0",
    "react-dom": "19.0.0",
    "react-hook-form": "^7.57.0",
    "react-native": "0.79.3",
    "react-native-device-info": "^14.1.1",
    "react-native-gesture-handler": "~2.24.0",
    "react-native-gifted-charts": "^1.4.61",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-launch-arguments": "^4.1.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-quick-base64": "^2.2.2",
    "react-native-reanimated": "~3.17.4",
    "react-native-safe-area-context": "5.4.0",
    "react-native-screens": "~4.11.1",
    "react-native-select-dropdown": "^4.0.1",
    "react-native-svg": "15.11.2",
    "react-native-svg-transformer": "^1.5.1",
    "react-native-toast-message": "^2.3.3",
    "react-native-toggle-element": "^2.1.1",
    "react-native-video": "^6.14.0",
    "react-native-web": "^0.20.0",
    "react-native-webview": "13.13.5",
    "react-router-dom": "7.6.0",
    "react-webview": "^0.1.0",
    "zod": "^3.25.46"
  },
  "nx": {
    "includedScripts": []
  }
}

firebase.json for react-native-firebase v6:

{
  "hosting": [
    {
      "target": "site1",
      "public": "apps/site/dist",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "appAssociation": "NONE",
      "headers": [
        {
          "source": "/.well-known/apple-app-site-association",
          "headers": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "site2",
      "public": "apps/site/dist",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    }
  ],
  "functions": {
     ...
    }
  }
}

.firebaserc

{
  "projects": {
    "default": "projectId-non-prod",
    "devtest": "projectId-non-prod
    "production": "projectId-prod"
  },
  "targets": {
    "projectId-non-prod": {
      "hosting": {
        "site1": [
          "site-id-1-in-non-prod-project"
        ],
        "site2": [
          "site-id-2-in-non-prod-project"
        ]
      }
    },
    "projectId-prod": {
      "hosting": {
        "site1": [
          "site-id-1-in-prod-project"
        ],
        "site2": [
          "site-id-2-in-prod-project"
        ]
      }
    }
  },
  "etags": {}
}

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 info Fetching system and libraries information...
System:
  OS: macOS 15.5
  CPU: (8) arm64 Apple M2
  Memory: 114.56 MB / 24.00 GB
  Shell:
    version: 5.2.32
    path: /opt/homebrew/bin/bash
Binaries:
  Node:
    version: 24.0.1
    path: ~/.nvm/versions/node/v24.0.1/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.3.0
    path: ~/.nvm/versions/node/v24.0.1/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK:
    API Levels:
      - "34"
      - "35"
    Build Tools:
      - 30.0.3
      - 35.0.0
      - 35.0.1
      - 36.0.0
    System Images:
      - android-36 | Google Play ARM 64 v8a
      - android-36 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13363775
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.0
    wanted: ^18.0.0
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.3
    wanted: 0.79.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.82.0 is now available (your project is running on v0.79.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.79.3&to=0.82.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 22.2.1
  • Firebase module(s) you're using that has the issue:
    • remote-config
  • Are you using TypeScript?
    • Y & 5.8.3


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions