React Native iOS No Bundle URL present but only when using a real device - react-native

I am trying to build a project that we have previously built many times on a real device through xcode but not it throws a No Bundle URL present error the moment the app boots.
I have tried updating the app, rebooting and updating the info.plist file but nothing seems to change it.
Other apps are booting fine.
I have my info and the error below.
Error Screen

Check whether you are running correct Project. Clean you build folder and then Run .

Seems like this is a common issue for some. I'd suggest checking out this thread with others that had a similar issue - What is the meaning of 'No bundle URL present' in react-native?

Related

Output: "[Warning] Could not find workspace while activating"

I'm getting this error when opening VS Code. Does anyone know what it means? I've done some research but didn't get any relevant information :(
I've tried creating a workflow to see if the error disappeared, but it didn't.
It seems that react native is asking for a workspace to start but is it asking that in the first place? Can I disable react native from running when opening VS Code?
The folder opened when the screenshot above was taken was the folder it opens by default, I believe it's the mac "home" personal folder, and I have a folder called "git" inside of it, with all projects.
Given the date of this posting (2023-02-07), you're probably on version 1.10.0 of the extension. This sounds like this bug report in the microsoft/vscode-react-native GitHub repo: [Bug] Extension activating when it shouldn't #1891.
A fix is coming in version 1.10.1.
But it is taking some time and has not been release yet at the time of this writing 2023-01-31:
we're facing some problems in the last release process, recently we're waiting for new publishing PAT access to republish 1.10.1 again, maybe it will publish on marketplace on next week. We have nightly version for extension in marketplace as well, maybe you can use it now.
For now, you can try installing the nightly version.
Also, note from the extension's readme documentation:
Before going any further make sure that you:
have a working React Native environment.
have the emulator utility available in your PATH if you're developing Android applications.
[...]
Got it, this annoying log came from React Native Tools extension. They specify the requirements in the docs:
In my case, I don't have a specific React Native environment or the emulator PATH is not right.

Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle index.android.bundle is packaged

So this has been asked before but I'm asking it again because nothing has worked, I've read through all of the similar posts I could find and all but one has semi fixed the problem.
https://medium.com/#adityasingh_32512/solved-unable-to-load-script-from-assets-index-android-bundle-bdc5e3a3d5ff
This medium article is the only solution that i can find that will get debug builds running again but that is only because it is pre packaging the javascript bundle and not really fixing the problem of the app not connecting to the metro server, once the debug build is running via this method I'm unable to shake the device and get the debug menu to show up.
I've been developing this app for probably 10 months, live for 3-4 months, and can usually trudge through these errors that pop up but this one is tricky.
I've been using cleartextTrafficPermitted="true", tried implementing a custom network security config android:networkSecurityConfig="#xml/network_security_config", tried a different physical device, cleared the metro cache, deleted .gradle/ build folders, cleaned, rebuilt.. All with the same end result of the app crashing on boot and the same error in logcat Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.
Release builds work but that's because its not trying to connect to the metro server, pretty stumped on this one.
Answering this for others that might find it useful. Still not sure what I did wrong but in the process of setting up a CI/CD pipeline for the app I re cloned the project and magically android debug builds started working again. No changes to the code, the android project must have gotten corrupted somehow so recloning allowed android studio to start from square one. Weird one.

React Native Android debug build is using the prebuilt bundle instead of connecting to Metro

When I try to run my application on android using react-native run-android the app is not connecting to the Metro server but is using the bundle file in android/app/src/main/assets instead.
When I delete the bundle file I get two error screens that tell me that a bundle file could not be found and that a connection to the Metro server could not be made:
This happens on both my physical device and a local emulator, but on iOS devices everything works as expected. I'm pretty clueless what might be causing this. I've also tried deleting all the build output and node_modules without any result.
So after a lot of googling I found out what the issue was...
Some time ago the android API level was updated to level 28, and since API level 28 you need to specify if you want to use HTTP.
Metro uses HTTP for bundling so that's why it wasn't working.
I solved it by adding this line in the application part of AndroidManifest.xml:
android:usesCleartextTraffic="true"

Could not determine wrapper version

I've created a react native app, by simply doing:
react-native init app
I've followed this tutorial: Facebook Getting Started (I use Linux)
and I have done exactly what it says.
However, when I try to run the app (react-native run-android), I got the following message:
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Exception in thread "main" java.lang.RuntimeException: Could not determine wrapper version.
at org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:111)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: java.lang.RuntimeException: No build receipt resource found.
at org.gradle.wrapper.GradleWrapperMain.wrapperVersion(GradleWrapperMain.java:97)
... 1 more
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
```
How can I solve this problem?
According to this link
https://github.com/MinecraftForge/ForgeGradle/issues/227
it's because you have some special character in your project path (like "!")
I got the same issue in a Flutter project as I was organizing some of my projects. In my case also found that my source path contained special characters when I change the folders, after removing it works perfectly fine. This will usually happen to project that contains java code and I think this is because java is compiled based on the path you provide, so the compiler does not understand the special characters we used

Using Worklight JSONStore

I am not that new to Worklight, but the JSONStore is a new feature and I'm trying to learn how to use it. I downloaded the sample app (module_07_10_Using_JSONStore.zip) and installed it in my development environment, ran build and deployed it.
When I preview the app (as Android) in the Mobile Browser Simulator, and run through the sequence of Initialize the Collection, Add a Document, and then try to Find by Name, Find All, or get Number of Documents in Collection - I do not see the table at the bottom of the screen that displays the input data. I don't see any errors in the WL console. In the Android console, I get the error messages:
Unable to resolve target 'android-8'
WARNING: unable to write jarlist cache file - and then it points to location of jarlist.cache in the module.
I did not make any changes to the code. I looked it over, compared it to the education module content, and I don't see the problem. Any thoughts? Clues? Your help is appreciated. Thanks.
JSONStore is not supported in the Mobile Browser Simulator, it must run on an Android or iOS device or simulator, if you run it on the Android simulator it should work just fine.