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.

Unable to run react-native app on iOS12 device with xcode10

See original GitHub issue

Environment

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
      Memory: 474.75 MB / 8.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.1 - ~/.nvm/versions/node/v8.11.1/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.1/bin/npm
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 25, 26, 27, 28
        Build Tools: 23.0.1, 25.0.1, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.1
        System Images: android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728 
      react-native: 0.57.4 => 0.57.4 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Iphone info:
  Iphone X, iOS version 12.0 (16A366)

Description

The issue started after upgrading to xcode 10 and building for iOS 12 devices. First occurred in an existing project, therefor decided to try it out with a new one. Both existing project and new app are building perfectly fine for simulator, but when building for a device two things happen:

  • The error message "Could not launch projectname. Iphonename’s iphone had denied the launch request.
  • Connection with bundler is lost right away, therefor no errors in both xcode and metro bundler.
  • The app is stuck on launch screen.

Extra notes

  • After removing the “Apple Worldwide Developer Relations Certification Authority” certificate (see: https://stackoverflow.com/questions/52415694/ipad-has-denied-the-launch-request-after-update-to-ios-12) from keychain: the app just closes right away after launch. Again, connection with bundler is lost right away, therefor no errors in both xcode and metro bundler.

  • Actually, sometimes the app even completely freezes the entire device, it becomes unresponsive for several minutes.

  • I have tried it with multiple iOS12 devices. Have tried both legacy built settings and new (xcode10) built settings. Both fail for device.

  • It does built on a device for iOS 11.

  • Very occasionally (2 times out of 30) the app did start bundling and building after waiting for for 1/2 minutes. The following appeared in the logs:

2018-11-09 10:40:42.353351+0100 testapp[321:8597] XPC connection interrupted
2018-11-09 10:41:29.267063+0100 testapp[321:8597] NSURLConnection finished with error - code -1001
2018-11-09 10:41:29.285642+0100 testapp[321:8593] Task <D2118C0E-6B2F-46AA-9D8B-F6CD56B041EE>.<0> HTTP load failed (error code: -999 [1:89])
2018-11-09 10:41:29.285 [info][tid:main][RCTCxxBridge.mm:216] Initializing <RCTCxxBridge: 0x281a18000> (parent: <RCTBridge: 0x280e185b0>, executor: (null))
2018-11-09 10:41:29.289055+0100 testapp[321:8531] Initializing <RCTCxxBridge: 0x281a18000> (parent: <RCTBridge: 0x280e185b0>, executor: (null))
2018-11-09 10:41:29.429068+0100 testapp[321:8592] [] nw_socket_handle_socket_event [C2.1:1] Socket SO_ERROR [61: Connection refused]
2018-11-09 10:41:29.431 [info][tid:main][RCTRootView.m:293] Running application testapp ({
    initialProps =     {
    };
    rootTag = 1;
})
2018-11-09 10:41:29.430976+0100 testapp[321:8531] Running application testapp ({
    initialProps =     {
    };
    rootTag = 1;
})
2018-11-09 10:41:29.431317+0100 testapp[321:8592] [] nw_socket_handle_socket_event [C2.2:1] Socket SO_ERROR [61: Connection refused]
2018-11-09 10:41:29.431652+0100 testapp[321:8591] [] nw_connection_get_connected_socket [C2] Client called nw_connection_get_connected_socket on unconnected nw_connection
2018-11-09 10:41:29.431701+0100 testapp[321:8591] TCP Conn 0x2810183c0 Failed : error 0:61 [61]

Note the 'HTTP load failed and then the app started building.

Reproducible Demo

Steps:

  1. react native init projectname
  2. cd ./projectname && yarn
  3. open ./ios/zwangerhapapp.xcodeproj
  4. Create app id and ad hoc provisioning profile for new app. Apply these in the new project and remove tvOS/tvOSTests/Tests targets.
  5. Built app for connected iOS12 device.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

5reactions
PaulvanMotmancommented, Nov 12, 2018

https://stackoverflow.com/questions/45421179/xcode-9-error-iphone-has-denied-the-launch-request

See the second answer:

“I tracked this problem down to the “debug executable” checkbox in the product scheme (product->scheme->edit scheme->info->debug executable checkbox). I unchecked that and this stopped happening (as well as a couple other weird issues - no output in console being one).”

This fixed all issues for me, but it’s not optimal since the connection with the xcode debugger is lost.

0reactions
mpmprudenciocommented, Jun 17, 2019

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run react native IOS application on device due ...
We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by...
Read more >
Running On Simulator
Once you have your React Native project initialized, you can run npx react-native run-ios inside the newly created project directory. If ...
Read more >
"react-native run-ios --device" failing with error.
The react-native run-ios --device command fails with an error. The app runs on the simulator using the react-native run-ios command without any problem....
Read more >
iOS Simulator
Open up the Mac App Store, search for Xcode, and hit install (or update if you have it already). If you're unable to...
Read more >
How Run and Test React Native / Expo On Your Apple iOS ...
Error above means you either don't have Xcode installed, or it's not linked, see below how to install it. Install Xcode for Expo...
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