cengit / react-native-issue

react-native related issues found when I working on the RN project development
0 stars 0 forks source link

No bundle URL present when start APP on ios simulator #2

Open cengit opened 2 years ago

cengit commented 2 years ago

error

No bundle URL present.

Make sure you're running a packager server or have included a .jsbundle file in your application bundle.

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
cengit commented 2 years ago

fixing is quite simple, check setting: ios/eBriefcase/Info.plist

Before:

<dict>
    <key>NSAllowsArbitraryLoads</key>
    <false/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>localhost</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <false/>
        </dict>
    </dict>
</dict>

set NSExceptionAllowsInsecureHTTPLoads to true, will fix this issue.

<dict>
    <key>NSExceptionAllowsInsecureHTTPLoads</key>
    <true/>
</dict>

on simulator, load bundle from localhost, we must allow NSExceptionAllowsInsecureHTTPLoads