App stucks on splash screen when build Archive iOS
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment: OS: macOS Sierra 10.12.6 Node: 8.2.1 Yarn: 1.3.2 npm: 5.6.0 Watchman: 4.9.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4408382
Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.51.0 => 0.51.0
Actual Behavior
When building my app for Debug or Release, everything works fine, the app launches and loads js. But when I pack my app for Archive (Release version), it stucks on LaunchScreen.
UPD: I tried uploading archive to TestFlight and to Crashlytics Beta. Both have same result. App doesn’t launch further then LaunchScreen.
AppDelegate.m
/**
* 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 <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
[Fabric with:@[[Crashlytics class]]];
// jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"App"
initialProperties:nil
launchOptions: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];
UIView* launchScreenView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] objectAtIndex:0];
launchScreenView.frame = self.window.bounds;
rootView.loadingView = launchScreenView;
return YES;
}
@end
index.js
import React, {Component} from 'react';
import { AppRegistry } from 'react-native';
import App from './App';
// console.disableYellowBox = true;
AppRegistry.registerComponent('App', () => App);
App.js
import React, {Component} from 'react';
import {StackNavigator, TabNavigator} from 'react-navigation';
import SplashScreen from './src/views/splashScreen';
import LoginView from './src/views/loginView';
import SuppliesView from "./src/views/SuppliesView";
import ProductsView from "./src/views/ProductsView";
import ScanView from "./src/views/ScanView";
import ReadyView from "./src/views/ReadyView";
const Navigator = StackNavigator({
SuppliesView: {
screen: SuppliesView
},
ProductsView: {
screen: ProductsView,
},
ScanView: {
screen: ScanView,
},
ReadyView: {
screen: ReadyView
}
});
const MainNavigator = TabNavigator({
Main: {
screen: Navigator,
navigationOptions: {
header: null,
},
}
});
const MainApp = StackNavigator({
Splash: {
screen: SplashScreen,
navigationOptions: {
gesturesEnabled: false,
},
},
Login: {
screen: LoginView,
},
Main: {
screen: MainNavigator,
}
});
export default class App extends React.Component {
render() {
return <MainApp />;
}
}
package.json
{
"name": "App",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.19.2",
"moment-timezone": "^0.5.14",
"numeral": "^2.0.6",
"react": "16.0.0",
"react-native": "0.51.0",
"react-native-blur": "^3.2.2",
"react-native-camera": "^0.12.0",
"react-native-fabric": "^0.5.1",
"react-native-i18n": "^2.0.9",
"react-native-linear-gradient": "^2.3.0",
"react-native-navigation": "^1.1.348",
"react-native-sound": "^0.10.4",
"react-navigation": "^1.0.0-beta.19",
"underscore": "^1.8.3",
"url": "^0.11.0"
},
"devDependencies": {
"babel-jest": "21.2.0",
"babel-preset-react-native": "4.0.0",
"jest": "21.2.1",
"react-test-renderer": "16.0.0"
},
"jest": {
"preset": "react-native"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:11 (3 by maintainers)
Top Results From Across the Web
ios app get stuck at splash screen - Google Groups
1) flutter build iOS —release · 2) Closing xcode and again reopen with xcworkspace once above command gets complete. · 3) Then generating...
Read more >App freezes on Launch Screen for s… - Apple Developer
When building and running from Xcode the app will freeze on launch screen for several minutes (average about 2min) and then after wakes...
Read more >Release build loads only the splash screen of the app in IOS ...
flutter build ios --release. Now, open XCode and clean project then make your archive. Your issue of stuck in Splash is resolved.
Read more >iPad running iOS 12 -- Stuck on Splash Screen #22765 - GitHub
Workaround... by completely removing all Derived Data and all intermediate build files, then building from the command line, then building a ...
Read more >App stuck on SplashScreen forever on iOS using SDK23
Hi, My App runs fine with the splash info on app.json, image is shown and everything runs smooth. App was created with CRNA....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Turns out that the problem for me was that CocoaPods was also building react.
The solution was to remove React from the Pods targets in this tab:
Good Luck!
same problem =(