question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App stuck at splash screen

See original GitHub issue

When openning an issue, please include following information for better support

  1. What version of RN and react-native-fcm are you running: 0.48.4 and 10.0.0?
  2. What device are you using? (e.g iOS9 emulator, Android 6 device): iOS 9.0 Emulator and ios 10.3.3 phone. The error occurs on both the devices
  3. Is your app running in foreground, background or not running? Foreground

App is stuck at splash screen.

Here are the logs from xcode:

Oct  8 20:59:28  Frills[15019] <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  8 20:59:28  Frills[15019] <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
Oct  8 20:59:28  Frills[15019] <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
2017-10-08 15:29:28.305 [info][tid:main][RCTCxxBridge.mm:187] Initializing <RCTCxxBridge: 0x7f83da5a8670> (parent: <RCTBridge: 0x7f83da5e2d20>, executor: (null))
2017-10-08 15:29:28.314 [warn][tid:main][RCTBridge.m:114] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2017-10-08 20:59:28.367 Frills[15019] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2017-10-08 20:59:28.377 Frills[15019] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.4000000 started
2017-10-08 20:59:28.379 Frills[15019] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2017-10-08 20:59:28.387 Frills[15019] <Notice> [Firebase/Analytics][I-ACS003007] Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist
2017-10-08 20:59:28.433 Frills[15019] <Notice> [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. Add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2017-10-08 20:59:28.450 Frills[15019] <Warning> [Firebase/Analytics][I-ACS032003] iAd framework is not linked. Search Ad Attribution Reporter is disabled.
2017-10-08 20:59:28.486 Frills[15019] <Notice> [Firebase/Analytics][I-ACS023012] Firebase Analytics enabled

This is my pod file:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

pod 'Firebase/Core', '4.0.0'
pod 'Firebase/Messaging'

target 'AppName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for AppName

  target 'AppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

This is my AppDelegate.m file

/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import "AppDelegate.h"
#import "RNFIRMessaging.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
#import "RCCManager.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  // RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
  //                                                     moduleName:@"Frills"
  //                                              initialProperties:nil
  //                                                  launchOptions:launchOptions];
  // 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];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.window.backgroundColor = [UIColor whiteColor];
  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];

  [FIRApp configure];
  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
  return YES;
}

// URL SCHEME HANDLING CODE
- (BOOL)application:(UIApplication *)application
   openURL:(NSURL *)url
   options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
  return [RCTLinkingManager application:application openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
 return [RCTLinkingManager application:application
                  continueUserActivity:userActivity
                    restorationHandler:restorationHandler];
}


- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
{
  [RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler];
}

#if defined(__IPHONE_11_0)
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler
{
  [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
}
#else
- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)())completionHandler
{
  [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
}
#endif

-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [RNFIRMessaging didReceiveLocalNotification:notification];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  [RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

// END OF SCHEME HANDLING


@end

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
harshattraycommented, Dec 15, 2017

Adding GoogleService-info.plist itself didnt solve the problem . I had to Click on the Target app > Build phases , within which I had to add GoogleService-info.plist manually to the Copy Bundle Resources section. screen shot 2017-12-15 at 5 32 18 pm

This fixed it for me . Hope this finds some relevance in your projects

1reaction
mekoahddcommented, Dec 11, 2017

Update react-native@0.50.4 works for me!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix app stuck on the splash screen on iOS - MacVangelist
Steps to fix app stuck on the splash screen on iOS · Step 1 – Disable your Internet connection, wait 10 seconds and...
Read more >
Apps not Launching/ stuck on splash screen : r/android_beta
sometimes it decides to open but get stuck on the splash screen. I keep restarting it, and even shut it down from the...
Read more >
App is stuck on Splash screen - Expo Development Tools
From March 21 2022 onwards the builds pushed to TestFlight and Google Play are not working. The app is stuck on the splash...
Read more >
iOS : App get stuck on Splash screen - Stack Overflow
close Xcode; going into the finder; go to the list of applications; select XCode and do Cmd + i; uncheck the box "Open...
Read more >
App stuck on splash screen on Android #6931 - GitHub
Open the app on Android · App is stuck on Splash Screen · You have to close and reopen the app to enter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found