React Native on Android freezes after debugging for awhile - react-native

I've hooked up my brand new Kindle Fire 7 to my Mac and I've run react-native run-android successfully on it with Hot Reload and Remote JS Debugging enabled.
Everything seems to work fine for about 30 minutes or so, before the app completely freezes (no console.log statements show up, no UI updates, etc). When I shake my Fire, the debug menu does pop up (Reload, Stop Remote JS Debugging, Enable Live Reload, etc.), but tapping on any option is just as unresponsive.
If I run adb devices at this point on my Mac, I see that the Kindle Fire has disconnected. If then unplug the USB connection to my Fire, reconnect, and run react-native run-android again, everything works again for about 30 minutes and then it is unresponsive once more.
Has anyone else run into this issue? Thanks!
Note: I also highly doubt that my code is crashing the app... I'm just displaying the time on there with a single setInterval that grabs the current time. But just to be sure, I tried running with just a button that prints to the console on tap. That also stops working after running on the tablet for awhile.

Related

Expo TaskManager crash when killing app on android?

I am running a background task to track locations with Location.startLocationUpdatesAsync(). Everything works great. However if I kill the app by swiping up on Android, I get a message that says "MyApp keeps stopping". I have isolated the problem to the TaskManager. Whenever I don't use it, there is no problem killing the app.
I have searched for a solution for weeks with no luck. My guess is the TaskManager keeps running, but runs into some problem since the app has been unmounted. Is there anyway to run a clean up function when killing the app to unregister all tasks or is there a better way to do this?

Expo debug remote JS causes unresponsiveness in UI

I upgraded a react native project recently from expo SDK 36 to 38. It compiles now, but anytime I click on "Debug Remote JS", it causes the UI to become slow and unresponsive, only occasionally picking up the on click events. I created a bare bones project to duplicate it. To verify, either run expo init from cli or here's a project https://github.com/seniordevops/tab-application.git. Click the tabs without the debugger on, then turn on debug remote JS and watch the slow down. Happens on both Mac and PC. Any ideas on the root cause?
This is mostly due to the fact that the clock on your PC and mobile are not synchronized.
You either have to synchronize them or have the phone clock one second earlier than your PC/Mac.
I suspect the reason could be an upstream problem of react-native. Please check this expo-cli issue:
https://github.com/expo/expo-cli/issues/2405
a maintainer reports:
when you are debugging on your device, the javascript is being
executed in your browser on your computer :(

How to enable auto-reloading in expo?

Ive been trying to make a simple app in react native using expo, till yesterday when i saved my app.js file it automatically refreshed the app running on my phone but today i tried running the app it doesnt reload when i save the file after making changes and im also getting this new window till yesterday all was working fine i dont know what happened today. when i click reload on the reload button it reloads but it was much easier when it was automatically refreshing everytime i save.
Looks like you have enabled Debug mode and disabled Fast Refresh. Open the developer menu: https://docs.expo.io/workflow/debugging/#developer-menu
iOS Device: Shake the device a little bit, or touch 3 fingers to the
screen.
iOS Simulator: Hit Ctrl-Cmd-Z on a Mac in the emulator to simulate the
shake gesture, or press Cmd+D.
Android Device: Shake the device vertically a little bit, or run adb
shell input keyevent 82 in your terminal window if your device is
connected via USB.
Android Emulator: Either hit Cmd+M, or run adb shell input keyevent 82
in your terminal window.
Then Enable Fast Refresh.
You might want to also disable Debug Mode by selecting Stop Remote Debugging (this will improve performance and get rid of that localhost window you posted)

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 )

iPod App crashes on launch

Is it normal that when i try to test my app it crashes on launch?
I explain.
I have my app that works fine in the simulator. I wanted to try to test it on my iPod Touch 4g.
I built and run from XCode, and that's what happened: the app launches fine (it shows me a black splash screen),but then suddenly it comes back to the springboard,with no reason.
If i open up the app manually,after it crashed,it works without any problems. It happens only one time,just when i build and run,and i don't know why.
How can i do to avoid this? On simulator it works with any crashes,but when i run it over my iPod,it crashes.
Program ended with exit code: 0 // on simulator
The app is likely to be failing to run on the device as xcode is trying to attach the debugger to it but doesn't have permission to do so.
Check your entitlements.plist within your project; you probably have one that has get-task-allow set to NO. This needs to be 'YES' to allow the debugger to attach. (It does need to be 'NO' for adhoc builds though - one solution is to exclude the entitlements.plist file from the debug build.)