-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Issue
I was able to run my app in both android and ios to the extent that I was able to verify my v6 firebase connection through the google console. However, once I ran react-native link @react-native-firebase/app
and pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
was added to my Podfile, I encountered a number of errors.
First was that I had the duplicate react references, so I added
pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
to my Podfile. This fixes the react duplication issue, but now I get a variety of compile errors when I run react-native run-ios
. It is usually only one error at a time, things like:
The following build commands failed:
CompileC /Users/.../ios/build/tgs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTJavaScriptLoader.o /Users/.../node_modules/react-native/React/Base/RCTJavaScriptLoader.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
or
The following build commands failed:
CompileC /Users/.../ios/build/tgs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTBlobManager.o /Users/.../node_modules/react-native/Libraries/Blob/RCTBlobManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
or
The following build commands failed:
CompileC /Users/.../ios/build/tgs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBApp.build/Objects-normal/x86_64/RCTConvert+FIROptions.o /Users/.../node_modules/@react-native-firebase/app/ios/RNFBApp/RCTConvert+FIROptions.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
These variations happen presumably because I keep tinkering with the Podfile, I've tried adding
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
instead of pod 'React', :path => '../node_modules/react-native'
, as well as specifying some React subspecs. Nothing has gotten me back to these compile errors. If I modify my Podfile to remove pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
then I'm able to run ios again and have it work.
I have gotten actual real authentication to work with android, but can't even get ios to run. I've also linked @react-native-firebase/auth, but since the issue seems to happen before I get to that step in ios I didn't go into it here.
These are my npm dependencies (and I have uninstalled, verified cache, and reinstalled many times)
"@react-native-firebase/app": "^6.0.0-alpha.25",
"@react-native-firebase/auth": "^6.0.0-alpha.25",
"react": "^16.8.6",
"react-native": "^0.59.9",
"react-native-gesture-handler": "^1.3.0",
"react-navigation": "^3.11.0"
I have tried:
- Doing Product -> Clean , close Xcode, reinstall pods, Product -> Clean.
- Setting my Workspace Settings -> Build System to Legacy Build System.
- Many, many variations of the Podfile.
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
- many times before different attempts to run.- Deleting the ios/build directory
I would really appreciate any help, thank you.
Project Files
iOS
Click To Expand
ios/Podfile
:
- I'm not using Pods
- I'm using Pods and my Podfile looks like:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'tgs' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for tgs
pod 'Firebase/Core', '~> 5.20.2'
pod 'Firebase/Auth', '~> 5.20.2'
pod 'React', :path => '../node_modules/react-native'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
end
AppDelegate.m
:
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@import Firebase;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"tgs"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
Android
Click To Expand
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:
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Memory: 504.56 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
npm: 6.9.0 - ~/.nvm/versions/node/v12.2.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: ^16.8.6 => 16.8.6
react-native: ^0.59.9 => 0.59.9
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
- 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
Firebase
module(s) you're using that has the issue:e.g. Instance ID
- Are you using
TypeScript
?N
Think react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]
- 👉 Check out
React Native Firebase
andInvertase
on Twitter for updates on the library.