Major issues trying to run react native, expo, vs code, android studio - react-native

I am brand new to React-Native and have been consistently having major issues getting things up and running. I am using VS Code, Expo, Chrome, and Android Studio. I have encountered at least a dozen major issues trying to get a simple "Hello World" app running and none of the solutions to the particular problems has really worked leading me to believe there is a bigger issue going on. I'll try to run through a few of the issues I've had so far but as I said I'm totally new to this so I can't really understand/remember every issue that has come up.
I have consistently had issues getting metro bundler/expo and the Android Virtual Devices connecting. Sometimes they work, but most of the time I get the warning message "Couldn't adb reverse: device 'adb' not found" followed by the error message "Couldn't start project on Android: Error running adb: device 'adb' not found." If the device does work, if I try to reload from the developer menu or debug from the developer menu, expo crashes on the virtual device. Often I get a blank white screen and the developer menu will no longer open. I've had occasional success stopping the virtual device, restarting it, closing all expo windows, and trying to "run on android" from metro bundler. When this doesn't work, I've tried wiping the virtual device. Sometimes this works. Most often I have to delete the device and create a new one.
When I tried to run the debugger in Chrome, the times it appeared to work, I got console screens that didn't match any guides I've found online. Trying to force errors to understand the Chrome debugger completely crashed the virtual device. Had to close VS Code, Chrome, and delete the virtual device to be able to even begin again.
When I tried to follow guides to debug in VS Code I couldn't get that to work either. Regardless if I put in break points or not when I tried to run "attach to packager" it wouldn't output anything but I could hear my machine running really hard and VS Code seemed like it was trying to do something. I would have to close VS Code to get it working again. The other issue I would get an error telling me that Packager was running outside of VS Code. I would try to close down Android Studio and restart and I would get the same error. One time I almost got it working but the virtual device completely crashed and started flashing a white screen and had to be deleted.
I've had tons of other random errors that have only happened once or twice including some warning message about the binary of the android devices being obsolete or something like that.
Anyone have any idea what could be causing all of this? I've been dealing with this for almost two weeks and it has become incredibly frustrating.

Related

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.

Stuck on Downloading Javascript Bundle 100% - Expo

I guess that I've tried every solution that exists on the internet about this issue, and nothing works, and I don't even know where to look anymore. It started to happen from nowhere and I can't even open the app settings shaking the phone, it's completely stuck on this screen.
I cleaned up NPM, Yarn, Expo's caches and disabled the Remote Dev Tools.
I would be so much thankful for any help.
In my case it was due to the a remote debugger.
I left the remote debugging on, put the mac in sleep and when I turned it on again the iOS Simulator remained stuck at bundling 100%, irrespective of what I've tried (kill simulator, expo r -c, Reload app, etc.)
However, I could have realized the root cause earlier because on the physical device it was working the entire time.
Hope this saves someone some time.
You could try reverting to your last known working commit, then incrementally adding back the changes until this happens again. This often is a result of delaying hiding the splash screen (perhaps via AppLoading or SplashScreen) and then not hiding it because of some error in the app code preventing the code to hide it from being called.
Try Disable Debug Remote JS in the IOS Simulator
by clicking ctrl + cmd +Z on Mac
It works for me.
Seems like something is wrong with the dependencies, just close down the react-native environment ( android studio) and your IDE, just closing and restarting may work if not, check for updates or delete and reinstall your dependencies ( expo i )

Successfully setting up React Native in Visual Studio Code for Mac

I'm having a real difficult time setting up React Native on Visual Studio Code on my mac. I have read multiple tutorials and watched youtube and Lynda videos on how to do it - follow the steps exactly as they are presented, but still it doesn't completely works. It seems like every other terminal command I run gets an error.
I have managed to get it running on my physical iPhone and in the Android emulator. But when I try get it up and running on my iOS simulator using the appropriate terminal command, it won't work. The simulator opens, but then the terminal seems to get stuck loading and the app isn't showing in the simulator. There's no error, but it doesn't run.
Another thing is that I don't seem to find the index.ios and index.android files respectively - just a single App.js file.
I guess what I'm asking for is a good thorough guid on setting it up. Most guides I come across seem to leave out or under-explain certain steps, assuming that you already understand certain concepts. Please post a link if you know any super guides :) Thanks!

Appcelerator Titanium does not run with sample application KitchenSink

I've installed Appcelerator Titanium Studio on a PC and I was not able to run the android simulator on it, so I was saying to myself "it should work on Mac at least"... and I installed a new Mac with Titanium on it, downloaded the SDK, then I imported the Kitchen Sink example and configured the run configuration with the default settings... and I'm getting exactly the same problem which is an infinite loop with the 'audio_flinged died' problem! So the best I can do is to view the Android simulator with the black window and "Android..." written on it.
What can I do to finally launch that example that is supposed to run? The best I did with my Windows 7 setup was to get the screen of an android cellphone WITHOUT any app on it (default apps), so it's pretty unuseful.
I'd really like to see what Titanium is capable to do.
The Mac ends (after a few mins) with "Launching New_configuration" has encountered a problem. Session initialization failed. "Session initialization failed Failed to get version"
The problem of the infinite loop with "AudioFlinger" still persist in the two cases (PC/Mac).
Any help would be greatly appreciated.
I helped someone with a similar question. He was getting a error which you don't seem to be but my answer walked him through checking the configuration was ok etc.
might help you:
Error running Android emulator from Titanium Studio

Mono4Android Cant upload to emulator

I am using Mono4Android and I have a huge problem.
After I compiled my programm(via run), I want to "upload it to a device".
So I am starting a Emulator and I wait, but the emulator is not listed a running, so I cannot test my program.
I am experiencing this problem on two computers, how to fix it?