4

I've modified the info.plist file on http request.

When I run a react-native project, I get a error no bundle URL present , but I don't know what mistakes I do,

my info.plist file

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
        <dict>
            <key>api.xxx.com</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
    </dict>
</dict>

enter image description here

  • run this in your terminal and then clean and rebuild your project. "react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ./ios/release/main.jsbundle --assets-dest ./ios/release/main.jsbundle" – Nitesh Mishra Mar 08 '17 at 13:08
  • Possible duplicate of [What means of no bundle URL present in react-native?](http://stackoverflow.com/questions/42610070/what-means-of-no-bundle-url-present-in-react-native) – urbancvek Mar 26 '17 at 15:51

10 Answers10

2

The simplest thing I found to solve this issue was to run

react-native start

which runs the React Packager. Leave this running while either using the emulator a device. For some reason, it's not mentioned in the docs anywhere.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
philipjc
  • 241
  • 3
  • 9
2

run the following code:

killall -9 node
rm -rf ios/build
react-native run-ios

it will open launchpackager.command and the application will install on the ios simulator

Saif Siddiqui
  • 856
  • 1
  • 13
  • 33
1

Reason is that because the file main.jsbundle inside of the iOS is not generated sometime or some time generated but wrong to solve this do following steps.

  1. Add the following line inside the scripts of the package.josn "build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
  2. Then run following command : yarn build:ios or npm run build:ios
  3. Open your Xcode select project then click of project name go to the build faces then click on copy build resources ass your main.jsbundle there
  4. Run the react-native run-ios

This work for me

shilovk
  • 11,718
  • 17
  • 75
  • 74
  • This solved my initial issue but the connection between the metro bundler and simulator going forward is just so unstable, reloading or doing anything will break stuff. Had a similar issue? – jones Oct 16 '20 at 10:24
0
  1. Run "react-native run-ios"
  2. When the error appears, run "npm install"
  3. Then run "react-native run-ios" again.

source: What means of no bundle URL present in react-native?.

Community
  • 1
  • 1
0

I met the same problem. Try this and I solve the problem

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>

source: react native ios no bundle URL present issue

Community
  • 1
  • 1
ppjerry
  • 91
  • 1
  • 2
0

Issue tested on Xcode 8, swift 3x

On terminal navigate to your project directory and upgrade the react native

react-native upgrade

if you want to explore more you can check the GitHub issue link

click to know more in github

Abdul Karim
  • 4,359
  • 1
  • 40
  • 55
0

Abdul Karim is correct, that is the only thing that solved my issue. The new command to upgrade now is

react-native-git-upgrade

You will first need to npm install

npm install -g react-native-git-upgrade
Tarek
  • 1
  • 1
0

What helped me was to the build folder and rerun the project

In terminal:

  1. rm -rf ios/build

  2. react-native run-ios

javascript2016
  • 973
  • 3
  • 17
  • 41
0
  1. minimise your app(Kill your application) dont delete it.. Press Ctrl + H in simulator.
  2. Go back to terminal and write npm install (not recommended always)
  3. Write react-native run-ios again and it will start.

That's just bundling issue nothing major!

Rishav Kumar
  • 4,979
  • 1
  • 17
  • 32
-1

first, ping 127.0.0.1 if 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.068 ms

second,ping localhost, if you localhost analysis ip is not your computer ip,we find the problem,reason:your localhost was modified,

third---you need modify your computer 127.0.0.1 with localhost, open /etc/hosts and set for example: save,reload your Internet Explorer

1 ## 2 # Host Database 3 # 4 # localhost is used to configure the loopback interface 5 # when the system is booting. Do not change this entry. 6 ## 7 127.0.0.1 localhost