3

Problem

I am trying to connect to a mobile phone to run a React Native app via XCode on MacOS. Unfortunately, the connection fails with the error: No bundle URL present

This is the full error:

2022-07-22 11:51:39.924974+0200 neoAppTemplate[85080:3120936] [connection] nw_connection_get_connected_socket [C1] Client called nw_connection_get_connected_socket on unconnected nw_connection 2022-07-22 11:51:39.925176+0200 neoAppTemplate[85080:3120936] TCP Conn 0x281158580 Failed : error 0:61 [61] 2022-07-22 11:51:49.796105+0200 neoAppTemplate[85080:3120936] Task <0BDA59B9-E698-4AAE-8049-4B42365D1BBF>.<1> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 “Zeitüberschreitung bei der Anforderung.” UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x282800d20 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 “(null)” UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0BDA59B9-E698-4AAE-8049-4B42365D1BBF>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( “LocalDataTask <0BDA59B9-E698-4AAE-8049-4B42365D1BBF>.<1>” ), NSLocalizedDescription=Zeitüberschreitung bei der Anforderung., NSErrorFailingURLStringKey=http://192.168.179.5:8081/status, NSErrorFailingURLKey=http://192.168.179.5:8081/status, _kCFStreamErrorDomainKey=4} 2022-07-22 11:51:49.849678+0200 neoAppTemplate[85080:3120676] [native] No bundle URL present.

Context

  • I am running on React Native 0.69.2

  • XCode 13

  • I added this to my Info.plist file:

          <dict>
              <key>NSExceptionDomains</key>
              <dict>
                  <key>localhost</key>
                  <dict>
                      <key>NSExceptionAllowsInsecureHTTPLoads</key>
                      <true/>
                  </dict>
              </dict>
              <key>NSAllowsArbitraryLoads</key>
              <true/>
              <key>NSAllowsArbitraryLoadsInWebContent</key>
              <true/>
              <key>NSAllowsLocalNetworking</key>
              <true/>
        </dict> 
    
  • I am connected to Metro

  • Both devices are on the same network

So what could the problem be?

Gh05d
  • 7,923
  • 7
  • 33
  • 64
  • 1
    Have you tried answers from [here](https://stackoverflow.com/questions/42610070/what-is-the-meaning-of-no-bundle-url-present-in-react-native) ? – Rohit Aggarwal Jul 22 '22 at 16:49
  • Yeah, basically everything :-( – Gh05d Jul 22 '22 at 22:34
  • 2
    I have the same issue, having just migrated to a new Mac. Absolutely baffled, if I solve it I'll post an answer. Please could you do the same if you happen to fix it? – Diziet Sep 09 '22 at 11:25
  • 1
    I basically gave up and used the Simulator instead. If I have to switch to a real phone again and somehow solve it, I will post the solution. – Gh05d Sep 09 '22 at 11:32

1 Answers1

1

Not the most ideal answer, I've currently given up trying to make it work over WiFI. The below has at least got me back on my feet.

With iPhone connected over USB, go to System Preferences->Network, find your device and untick "Disable unless needed" then press apply. Note down the IP address:

System Preferences->Network->iPhone USB

Manually set the IP address into the "Configure Bundler" in the apps shake to debug window. I'll update this again when/if I figure out the lack of WiFi connectivity.

Diziet
  • 2,397
  • 1
  • 26
  • 34