Closed SeongwoonHong closed 1 year ago
I even tried removing "firebase": "9.6.11"
package and nothing changes. This package is being used to store some data into firebase store.
I also tried using v15.4 and have use_frameworks! :linkage => :static
in Podfile but I was getting
** BUILD FAILED **
The following build commands failed:
SwiftCompile normal x86_64 Compiling\ StorageFactory.swift /Users/seong/Documents/usmobile/react-native-app/ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/StorageFactory.swift (in target 'FirebaseCoreInternal' from project 'Pods')
CompileSwift normal x86_64 /Users/seong/Documents/usmobile/react-native-app/ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/StorageFactory.swift (in target 'FirebaseCoreInternal' from project 'Pods')
(2 failures)
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseAnalytics', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
This is not supportable, you need to log issues against the current version here, with the strict requirement of using use_modules! :linkage => :static
If there is a module bringing in older + incompatible versions of firebase-ios-sdk Pods then you'll have to work with them, we stay current here. I'm not sure what Google Tag Manager needs, but it looks like you want version 6 there?
https://developers.google.com/tag-platform/tag-manager/ios/v5
I have a build harness I use to prove builds work, from scratch https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh
I recommend you check that repo out and try it, perhaps adding google tag manager to the generated project so you have a clean test bed to do a proof of concept on for the integration on the iOS platform.
pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseAnalytics', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true
This is not supportable, you need to log issues against the current version here, with the strict requirement of using
use_modules! :linkage => :static
If there is a module bringing in older + incompatible versions of firebase-ios-sdk Pods then you'll have to work with them, we stay current here. I'm not sure what Google Tag Manager needs, but it looks like you want version 6 there?
https://developers.google.com/tag-platform/tag-manager/ios/v5
I have a build harness I use to prove builds work, from scratch https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh
I recommend you check that repo out and try it, perhaps adding google tag manager to the generated project so you have a clean test bed to do a proof of concept on for the integration on the iOS platform.
Thank you for the reply! However I'm getting errors even when I use the current stable version of react-native-fire-base.
I tried using use_modules! :linkage => :static
, with react-native-firebase/app: 15.4.0
or even react-native-firebase/app: 16.2.0
. I'm getting an error
If I stay on 16.2.0
, and I use use_framework!
, I'm getting this
Please stop posting images, they are difficult for me to read as I am frequently on mobile. Github is a text medium and you may copy paste inside triple-backquotes to get nicely formatted text that anyone may read or quote-reply etc.
I don't know why GoogleTagManager is pulling in an old version of FirebaesAnalytics and FirebaseCore but that is outside the scope of this repository, we cannot help it if they are not current, and we certainly are not going to depend on firebase-ios-sdk v4 (they are on v10 now!)
It appears you are using the wrong version perhaps? https://cocoapods.org/pods/GoogleTagManager
pod 'GoogleTagManager', '~> 5.0'
Use this:
pod 'GoogleTagManager', '~> 7.4.2'
It uses firebase at v10
Hello π, to help manage issues we automatically close stale issues.\n\nThis issue has been automatically marked as stale because it has not had activity for quite some time.\nHas this issue been fixed, or does it still require attention?\n\n> This issue will be closed in 15 days if no further activity occurs.\n\nThank you for your contributions.
any one managed to resolve this issue in Mac m1 ?
same issue here
same issue...
Anyone having this issue, you must use compatible (typically that means "current") versions of the pods.
That would be current version of react-native-firebase and the current version of GoogleTagManager, which appears to be 7.4.3 now
If these are not both current, then some of the shared transitive dependencies will collide with incompatible versions, as clearly indicated in the error message
And on the cocopaods page for GoogleTagManager you can see the FirebaseAnalytics range it accepts, currently up to v11, which is okay for now as underlying firebase-ios-sdk is still v10.x https://cocoapods.org/pods/GoogleTagManager
This issue is not attracting useful comments and my statements above are definitive so I'm going to close this issue off, but please - if you find yourself having this issue, make sure that GoogleTagManager and the firebase-ios-sdk we are using are within each other's compatible version ranges. Here's the permalink to where we set the dependency so you can find it https://github.com/invertase/react-native-firebase/blob/f8b7794db23185c8a934a3e3623e996ce282c1f7/packages/app/package.json#L76 - be sure to switch it to "main" after locating it to see what version is actually current
Describe your issue here
This issue is iOS specific to me. I'm able to build and run android fine.
I'm trying to integrate Google Tag Manager into my app However I've ran into several issues.
when I do (in Podfile)
it gives me
so I had to add
:modular_headers => true
to each pods manually which can be seen in my current Podfile below and lowered the version of Google Tag Manager by doingpod 'GoogleTagManager', '~> 5.0'
and I'm getting the error messageSwiftEmitModule normal x86_64 Emitting\ module\ for\ FirebaseCoreInternal (in target 'FirebaseCoreInternal' from project 'Pods')
Project Files
Javascript
Click To Expand
#### `package.json`: ```json "dependencies": { "@datadog/mobile-react-native": "^1.0.0", "@datadog/mobile-react-navigation": "^1.0.0", "@react-native-async-storage/async-storage": "^1.16.1", "@react-native-clipboard/clipboard": "^1.10.0", "@react-native-community/checkbox": "^0.5.12", "@react-native-firebase/app": "^16.2.0", "@react-native-masked-view/masked-view": "^0.2.6", "@react-native-picker/picker": "^2.3.1", "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/material-top-tabs": "^6.1.1", "@react-navigation/native": "^6.0.6", "@react-navigation/stack": "^6.0.11", "@reduxjs/toolkit": "^1.8.0", "@types/color": "^3.0.3", "@types/react-native-snap-carousel": "^3.8.5", "axios": "^0.24.0", "base-64": "^1.0.0", "color": "^4.2.3", "creditcards": "^4.2.0", "creditcards-types": "^3.2.1", "date-time-format-timezone": "^1.0.22", "dayjs": "^1.11.0", "email-validator": "^2.0.4", "eslint-plugin-react-native": "^4.0.0", "events": "^3.3.0", "expo": ">=44.0.0-0 <45.0.0", "expo-contacts": "10.1.0", "expo-local-authentication": "~12.1.0", "firebase": "9.6.11", "immer": "^9.0.12", "intl": "^1.2.5", "jwt-decode": "^3.1.2", "libphonenumber-js": "^1.10.6", "lodash": "^4.17.21", "lottie-react-native": "^5.1.4", "moment-timezone": "^0.5.34", "react": "17.0.2", "react-hook-form": "^7.27.1", "react-native": "0.66.4", "react-native-android-open-settings": "^1.3.0", "react-native-chart-kit": "^6.12.0", "react-native-collapsible": "^1.6.0", "react-native-confirmation-code-field": "^7.3.0", "react-native-device-info": "^10.0.2", "react-native-dotenv": "^3.3.1", "react-native-dropdown-picker": "^5.4.2", "react-native-dynamic-vector-icons": "^1.1.6", "react-native-game-engine": "^1.2.0", "react-native-gesture-handler": "^2.1.1", "react-native-haptic-feedback": "^1.14.0", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-keychain": "7.0.0", "react-native-linear-gradient": "^2.5.6", "react-native-localization": "^2.1.7", "react-native-localize": "^2.2.0", "react-native-modal": "^13.0.1", "react-native-pager-view": "^5.4.11", "react-native-progress": "^5.0.0", "react-native-reanimated": "^2.3.1", "react-native-safe-area-context": "^3.3.2", "react-native-screens": "^3.10.1", "react-native-snap-carousel": "^3.9.1", "react-native-splash-screen": "^3.3.0", "react-native-svg": "^12.3.0", "react-native-swiper-flatlist": "^3.0.16", "react-native-tab-view": "^3.1.1", "react-native-toast-message": "^2.1.2", "react-native-vector-icons": "^9.0.0", "react-native-walkthrough-tooltip": "^1.3.0", "react-native-webview": "^11.18.2", "react-navigation-helpers": "^2.0.0", "react-redux": "^7.2.6", "redux-persist": "^6.0.0", "reselect": "^4.1.6", "rn-fetch-blob": "^0.12.0", "sp-react-native-in-app-updates": "^1.1.7", "use-immer": "^0.7.0", "zustand": "^4.0.0-rc.0" }, "devDependencies": { "@babel/core": "^7.16.7", "@babel/runtime": "^7.16.7", "@commitlint/cli": "^16.0.2", "@commitlint/config-conventional": "^16.0.0", "@react-native-community/eslint-config": "^3.0.1", "@types/lodash": "^4.14.180", "@types/react-native": "^0.66.12", "@types/react-redux": "^7.1.23", "@types/remote-redux-devtools": "^0.5.5", "@typescript-eslint/eslint-plugin": "^5.9.1", "@typescript-eslint/parser": "^5.9.1", "babel-plugin-inline-import": "^3.0.0", "babel-plugin-module-resolver": "^4.1.0", "eslint": "^8.6.0", "eslint-plugin-import": "^2.25.4", "husky": "^7.0.4", "metro-react-native-babel-preset": "^0.66.2", "prettier": "^2.5.1", "react-native-svg-asset-plugin": "^0.5.0", "react-test-renderer": "^17.0.2", "redux-devtools-extension": "^2.13.9", "remote-redux-devtools": "^0.5.16", "typescript": "^4.5.4" }, ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```
iOS
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby $RNFirebaseAsStaticFramework = true $FirebaseSDKVersion = '10.0.0' require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' platform :ios, '12.0' target 'USMClient' do use_expo_modules! # use_frameworks! # use_modular_headers! # pod 'Firebase/Core', '~> 6.3.0' # pod 'Firebase/CoreOnly', '~> 10.0.0' # pod 'Firebase/Core', '~> 6.3.0' # pod 'GoogleIDFASupport', '~> 3.14.0' pod 'react-native-webview', :path => '../node_modules/react-native-webview' pod 'RNReactNativeHapticFeedback', :path => '../node_modules/react-native-haptic-feedback' pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseAnalytics', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true pod 'GoogleTagManager', '~> 5.0' pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob' post_integrate do |installer| begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end end config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) target 'USMClientTests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. # use_flipper!() post_install do |installer| react_native_post_install(installer) __apply_Xcode_12_5_M1_post_install_workaround(installer) end end # # $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', # 'CocoaAsyncSocket', 'ComponentKit', 'DoubleConversion', # 'glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', # 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native'] # # pre_install do |installer| # Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} # installer.pod_targets.each do |pod| # if $static_framework.include?(pod.name) # def pod.build_type; # Pod::BuildType.static_library # end # end # end # end # # # post_install do |installer| # installer.pods_project.targets.each do |target| # target.build_configurations.each do |config| # config.build_settings['ENABLE_BITCODE'] = 'NO' # config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # end # end # react_native_post_install(installer) # end ``` #### `AppDelegate.m`: ```objc #import
#import "AppDelegate.h"
#if RCT_DEV
#import
#endif
#import
#import
#import
#import "RNSplashScreen.h"
#import
#ifdef FB_SONARKIT_ENABLED
#import
#import
#import
#import
#import
#import
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper =
[[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc]
initWithRootNode:application
withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc]
initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FIRApp configure];
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self
launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [self.reactDelegate createRootViewWithBridge:bridge
moduleName:@"USMClient"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f
green:1.0f
blue:1.0f
alpha:1];
// SplashScreen Initialization
[RNSplashScreen show];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef FB_SONARKIT_ENABLED
return
[[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"
fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main"
withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary *)options
{
return [RCTLinkingManager application:application openURL:url options:options];
}
@end
```
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`: ```groovy // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 } repositories { google() jcenter() } dependencies { classpath("com.android.tools.build:gradle:4.0.2") classpath "com.google.gms:google-services:4.3.14" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } google() jcenter() maven { url 'https://www.jitpack.io' } } } ``` #### `android/app/build.gradle`: ```groovy apply plugin: "com.android.application" apply plugin: "com.google.gms.google-services" apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" import com.android.build.OutputFile project.ext.react = [ enableHermes: true, // clean and rebuild if changing ] apply from: "../../node_modules/react-native/react.gradle" def enableSeparateBuildPerCPUArchitecture = false def enableProguardInReleaseBuilds = false def jscFlavor = 'org.webkit:android-jsc:+' def enableHermes = project.ext.react.get("enableHermes", false); android { compileSdkVersion rootProject.ext.compileSdkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId "appName" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion versionCode 30220 versionName "3.3.1" ndk { abiFilters "armeabi-v7a", "x86", 'armeabi', 'arm64-v8a', 'x86_64' } packagingOptions { exclude "lib/arm64-v8a/libgnustl_shared.so" } } splits { abi { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { debug { storeFile file('debug.keystore') storePassword 'android' keyAlias 'androiddebugkey' keyPassword 'android' } release { if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) { storeFile file(MYAPP_UPLOAD_STORE_FILE) storePassword MYAPP_UPLOAD_STORE_PASSWORD keyAlias MYAPP_UPLOAD_KEY_ALIAS keyPassword MYAPP_UPLOAD_KEY_PASSWORD } } } buildTypes { debug { signingConfig signingConfigs.debug } release { signingConfig signingConfigs.debug signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } applicationVariants.all { variant -> variant.outputs.each { output -> def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = versionCodes.get(abi) * 1048576 + defaultConfig.versionCode } } } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.facebook.react:react-native:+" // From node_modules implementation "com.facebook.soloader:soloader:0.9.0+" implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" implementation "com.google.android.gms:play-services-tagmanager:18.0.2" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' } debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' exclude group:'com.squareup.okhttp3', module:'okhttp' } debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { exclude group:'com.facebook.flipper' } if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; debugImplementation files(hermesPath + "hermes-debug.aar") releaseImplementation files(hermesPath + "hermes-release.aar") } else { implementation jscFlavor } } task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) ``` #### `android/settings.gradle`: ```groovy rootProject.name = 'USMClient' include ':react-native-android-open-settings' project(':react-native-android-open-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-open-settings/android') include ':rn-fetch-blob' project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') include ':rn-fetch-blob' project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') include ':react-native-haptic-feedback' project(':react-native-haptic-feedback').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-haptic-feedback/android') include ':react-native-webview' project(':react-native-webview').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview/android') apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle") useExpoModules() ``` #### `MainApplication.java`: ```java package someApp; import android.content.res.Configuration; import expo.modules.ApplicationLifecycleDispatcher; import expo.modules.ReactNativeHostWrapper; import java.util.List; import android.app.Application; import android.content.Context; import com.facebook.react.PackageList; import com.facebook.react.ReactApplication; import com.levelasquez.androidopensettings.AndroidOpenSettingsPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.RNFetchBlob.RNFetchBlobPackage; import com.mkuczera.RNReactNativeHapticFeedbackPackage; import com.reactnativecommunity.webview.RNCWebViewPackage; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import com.facebook.react.bridge.JSIModulePackage; import com.swmansion.reanimated.ReanimatedJSIModulePackage; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(this, new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
protected JSIModulePackage getJSIModulePackage() {
return new ReanimatedJSIModulePackage();
}
});
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
ApplicationLifecycleDispatcher.onApplicationCreate(this);
}
/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class> aClass = Class.forName("appName.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
}
}
```
#### `AndroidManifest.xml`:
```xml
```
Environment
Click To Expand
**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [O] 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:** - `"@react-native-firebase/app": "^16.2.0"` - **Are you using `TypeScript`?** - `Y` & `4.5.4`
React Native Firebase
andInvertase
on Twitter for updates on the library.