RNFirebase Admob banner initialization causing EXC_BAD_ACCESS crash ONLY in XCode 10.2. The app builds fine with XCode 10.1 and below.
This happens when I add the follwoing code to my render function
const Banner = firebase.admob.Banner;
const AdRequest = firebase.admob.AdRequest;
const request = new AdRequest();
return(
<Banner
unitId={this.bottomBannerAdId}
size={'SMART_BANNER'}
request={request.build()}
onAdLoaded={() => {
console.log('Advert loaded');
this.setState({bannerAdLoaded:true})
firebase.analytics().logEvent('bottomBannerLoaded', this.stateForAnalytics());
}}
/>
);
ios/Podfile
:# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
inhibit_all_warnings!
target 'APP_NAME' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for APP_NAME
# Your 'node_modules' directory is probably in the root of your project,
# but if not, adjust the `:path` accordingly
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
# Required by RNFirebase
pod 'Firebase/Core', '~> 5.15.0'
# [OPTIONAL PODS] - comment out pods for firebase products you won't be using.
pod 'Firebase/AdMob', '~> 5.15.0'
pod 'Firebase/Auth', '~> 5.15.0'
pod 'Firebase/Firestore', '~> 5.15.0'
pod 'Firebase/Functions', '~> 5.15.0'
# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'Fabric', '~> 1.7.13'
pod 'Crashlytics', '~> 3.10.7'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
end
AppDelegate.m
:#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNSplashScreen.h"
#import <Crashlytics/Crashlytics.h>
@import Firebase;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
[GADMobileAds configureWithApplicationID:@"ca-app-pub-ID"];
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"APP_NAME"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [UIColor blackColor];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
ADD_SOMETHING_HERE
e.g. iOS 10 or Android API 28N/A
N/A
N/A
XCode 10.2
e.g. Xcode 10, Android Studio 3.2React Native
version:react-native 0.58.3
React Native Firebase
library version:react-native-firebase 5.2.2
Firebase
module(s) you're using that has the issue:TypeScript
?N/A
ExpoKit
?ExpoKit
N/A
Think react-native-firebase
is great? Please consider supporting the project with any of the below:
React Native Firebase
and Invertase
on TwitterHello 馃憢, this issue has been automatically marked as stale because it has not had activity for quite some time. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
I also encounter this error. Kindly reopen.
Happened to me after updating to Xcode version 10.2 (10E125) yesterday
Getting this error after upgrading XCode Version 10.2 (10E125)
Downgrade Xcode to 10.1. @peteroid give a possible solution. It doesn't work with 12.2.
You can follow this issue here Banner on iOS crash
I am using Xcode 10.1 and I have the same issue.
same here, I have to release the build today but this thing confuses what to do ?
I have my xcode 10.2 updated.
and in the Apple Store, it is clearly says we should have the updated code that supports ios 12.1 SDK.
Hope we get the solution ASAP.
https://github.com/invertase/react-native-firebase/issues/2009#issuecomment-480825324
This was a banner issue it has been fixed.
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
I also encounter this error. Kindly reopen.