Replies: 1 comment
-
I am also facing this issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Subject: Issue Encountered with Firebase Remote Config
Dear Team,
I hope you are doing well. I'm writing to share a bug I've encountered in my app
related to Firebase Remote Config. Despite my research efforts, I haven't found a solution. Below is a detailed description of the issue along with relevant code
snippets:
Bug Explanation:
When attempting to fetch updated configurations using fetchAndActivate() from
Firebase Remote Config, I encountered the following error:
[Error: [remoteConfig/unknown] cancelled]
Code Overview:
Problem Occurrence:
The error occurs specifically during the fetchAndActivate() call within the
getAllRemoteConfigValues function, resulting in a [remoteConfig/unknown] cancelled error.
Project Files
package.json:
{
"name": "",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@invertase/react-native-apple-authentication": "^2.3.0",
"@react-native-async-storage/async-storage": "^1.22.3",
"@react-native-clipboard/clipboard": "^1.13.2",
"@react-native-firebase/analytics": "^19.2.2",
"@react-native-firebase/app": "^19.2.2",
"@react-native-firebase/app-check": "^19.2.2",
"@react-native-firebase/auth": "^19.2.2",
"@react-native-firebase/crashlytics": "^19.2.2",
"@react-native-firebase/dynamic-links": "^19.2.2",
"@react-native-firebase/firestore": "^19.2.2",
"@react-native-firebase/perf": "^19.2.2",
"@react-native-firebase/remote-config": "^19.2.2",
"@react-native-google-signin/google-signin": "^11.0.0",
"@react-navigation/bottom-tabs": "^6.5.16",
"@react-navigation/drawer": "^6.6.11",
"@react-navigation/native": "^6.1.14",
"@react-navigation/native-stack": "^6.9.22",
"@react-navigation/stack": "^6.3.25",
"@reduxjs/toolkit": "^2.2.1",
"@stripe/stripe-react-native": "^0.37.0",
"add": "^2.0.6",
"axios": "^1.6.7",
"date-fns": "^3.3.1",
"i18next": "^23.10.0",
"libphonenumber-js": "^1.10.57",
"lodash": "^4.17.21",
"lottie-react-native": "^6.6.0",
"react": "18.2.0",
"react-i18next": "^14.0.5",
"react-native": "0.73.5",
"react-native-asset": "^2.1.1",
"react-native-config": "^1.5.1",
"react-native-confirmation-code-field": "^7.3.2",
"react-native-contacts": "^7.0.8",
"react-native-device-info": "^10.13.1",
"react-native-email-link": "^1.15.0",
"react-native-gesture-handler": "^2.15.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-localize": "^1.3.0",
"react-native-paper": "^5.12.3",
"react-native-permissions": "^4.1.4",
"react-native-phone-input": "^1.3.7",
"react-native-reanimated": "^3.7.2",
"react-native-restart": "^0.0.27",
"react-native-safe-area-context": "^4.9.0",
"react-native-screens": "^3.30.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-vector-icons": "^10.0.3",
"react-native-version-number": "^0.3.6",
"react-redux": "^9.1.0",
"react-uuid": "^2.0.0",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"stripe": "^14.19.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.73.21",
"@react-native/eslint-config": "0.73.2",
"@react-native/metro-config": "0.73.5",
"@react-native/typescript-config": "0.73.1",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"eslint": "^8.19.0",
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
},
"engines": {
"node": ">=18"
}
}
iOS
ios/Podfile:
Resolve react_native_pods.rb with node to allow for hoisting
def node_require(script)
Resolve script with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
"require.resolve(
'#{script}',
{paths: [process.argv[1]]},
)", dir]).strip
end
node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')
platform :ios, min_ios_version_supported
prepare_react_native_project!
setup_permissions([
'AppTrackingTransparency',
'Bluetooth',
'Calendars',
'CalendarsWriteOnly',
'Camera',
'Contacts',
'FaceID',
'LocationAccuracy',
'LocationAlways',
'LocationWhenInUse',
'MediaLibrary',
'Microphone',
'Motion',
'Notifications',
'PhotoLibrary',
'PhotoLibraryAddOnly',
'Reminders',
'Siri',
'SpeechRecognition',
'StoreKit',
])
If you are using a
react-native-flipper
your iOS build will fail whenNO_FLIPPER=1
is set.because
react-native-flipper
depends on (FlipperKit,...) that will be excludedTo fix this you can also exclude
react-native-flipper
using areact-native.config.js
```js
module.exports = {
dependencies: {
...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
```
flipper_config =FlipperConfiguration.disabled;
$RNFirebaseAnalyticsEnableAdSupport = true
target '' do
use_frameworks! :linkage => :static
right after
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
config = use_native_modules!
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
use_react_native!(
:path => config[:reactNativePath],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'Tests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end
end
Android
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "25.1.8937393"
kotlinVersion = "1.8.0"
googlePlayServicesAuthVersion = "20.7.0"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath ("com.google.gms:google-services:4.4.1")
classpath ("com.google.firebase:firebase-crashlytics-gradle:2.9.9")
classpath ("com.google.firebase:perf-plugin:1.4.2")
}
}
apply plugin: "com.facebook.react.rootproject"
android/app/build.gradle:
apply plugin: "com.android.application"
apply plugin: "com.google.firebase.firebase-perf"
apply plugin: "com.google.gms.google-services"
apply plugin: "com.google.firebase.crashlytics"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
/**
This is the configuration block to customize your React Native Android app.
By default you don't need to apply any configuration, just uncomment the lines you need.
/
react {
/ Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
/**
*/
def enableProguardInReleaseBuilds = false
/**
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Date.toLocaleString
andString.localeCompare
that*/
def jscFlavor = 'org.webkit:android-jsc:+'
/-------------------------------------------------------------------------------
Apply the line below to support React Native Config
-------------------------------------------------------------------------------/
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
/-------------------------------------------------------------------------------
Handle Custom Fonts
-------------------------------------------------------------------------------/
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation platform("com.google.firebase:firebase-bom:32.7.3") //Firebase
implementation ("com.google.firebase:firebase-auth")
implementation ("com.google.firebase:firebase-analytics")
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
android/settings.gradle:
rootProject.name = ''
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
Environment
react-native info output:
System:
OS: macOS 14.4.1
CPU: (8) arm64 Apple M1
Memory: 139.95 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 21.7.1
path: /opt/homebrew/bin/node
Yarn: Not Found
npm:
version: 10.5.2
path: /opt/homebrew/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.14.3
path: /Users/muhammadfaizan/.rvm/gems/ruby-3.2.2/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.4
- iOS 17.4
- macOS 14.4
- tvOS 17.4
- visionOS 1.1
- watchOS 10.4
Android SDK:
API Levels:
- "33"
- "34"
Build Tools:
- 30.0.3
- 33.0.0
- 33.0.1
- 34.0.0
System Images:
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10671973
Xcode:
version: 15.3/15E204a
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /Users/muhammadfaizan/.rvm/rubies/ruby-3.2.2/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.5
wanted: 0.73.5
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Beta Was this translation helpful? Give feedback.
All reactions