I often get this exception trying to start a debugging session on Nuclide.
React Native Server: [...]/packager/packager.sh: line 11: node: command not found
Where [...] will represent the correct path to the packager
The server will indicate it's running, but it isn't. Running react-native run-ios from the command line will start its own packager session (successfully).
I also sometimes don't get this error message, but in either case, when I run react-native run-ios, a new packager will be started and the Simulator will indicate "Runtime is not ready for debugging" etc. And the error message always shows up when I restart the packager in Nuclide.
On Chrome, debugging works (although with extremely shaky support for debugger stops stopping at the right line, which why I'm trying Nuclide).
I did get it to work a few times. But it seems unreliable.
Any suggestions?
Uninstalling and reinstalling Nuclide did the trick
Related
I am working on a react-native project. I have been running the application on Android and iOS devices for the past 6 months. I haven't faced any problems till now. But suddenly today, while I am trying to run the application I am getting a compile error with the description. TypeError: Cannot read property 'indexOf' of undefined, js engine: hermes. I tried to debug the issue and found that there is an issue while connecting to the remote debugger. But the strange thing here is even I haven't selected the remote debugging option from either of emulator or simulator.
So, I have enabled the remote debugging option from the emulator to get a quick fix. It is working fine. But why is it connected to the remote debugger even after the fresh installation? And the quick fix comes with its own issues. The application is functioning a bit lag and inconsistent. I suspect there is an issue with the metro bundler. I have removed the cache using rm -rf /tmp/metro-* command, cleaned gradle using ./gradlew clean command, and cleaned iOS build by deleting derived Data. But still, the issue persists.
Is there any other step am I missing here? If it is the issue with the metro bundler, is there any way to reset it completely? Please check the attached image for more information.
The reason for this issue in my case is not with the metro bundler or its cache but with one of the third-party dependency named auth0-js(In your case it would be different). It is adding some global or window properties which are causing the above-mentioned issue. I have removed it and replaced with the library which is closed to react-native ecosystem which eventually resolved the issue.
I've been given a new React Native app to maintain and whenever I build it or run it in the simulator, I get the "Application has not been registered" error. There are no other errors in the console before this message (although there are some warnings). I can't find any code issues as if the error message is dismissed in the simulator, the app runs fine so the bundler is running correctly, although on an actual device, this registers as a crash on open.
I'm running in the simulator using react-native run-ios from the project root. Builds for running on actual devices is managed by Fastlane.
My app doesn't make an explicit call AppRegistry.registerComponent due (I think) to the way react-native-navigation is set up, so most of the info online about this error doesn't apply.
Where should I go next to figure this out?
I'm trying to run the following command to test the release version of my RN app locally:
react-native run-android --variant=release
Unfortunately, this fails to load the release version of the app into the emulator b/c it's failing with the following exception:
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:installRelease'.
com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException:
INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.socialmerge signatures
do not match previously installed version; ignoring!
Based on some googling I found the following thread:
Package signatures do not match the previously installed version
Some recommend uninstalling the previously installed version like this:
adb uninstall "com.MyDomain.MyApp"
I tried that as well as this:
adb uninstall com.MyDomain.MyApp
But both of these adb uninstall attempts return [DELETE_FAILED_INTERNAL_ERROR]. The following thread discusses the [DELETE_FAILED_INTERNAL_ERROR] error and some suggest disabling "Instant Run" in Android Studio. I have AS 3.5.2 and the closest match I can find to that are the following options which are unchecked by default:
"Automatically perform "Run" when Apply Changes fails
"Automatically perform "Run" when Apply Code Changes fails"
I'm assuming that these ^^^ options replace the previous "Instant Run" option but both of these options are unselected by default so it appears that disabling "Instant Run" is no longer relevant to debugging this issue. Any recommendations on next steps for debugging this issue?
I figured out this issue:
adb uninstall is case sensitive
uninstall app in your device first then try
react-native run-android --variant=release
I run into the same issue and I got it solved by wiping the data of the simulator.
Based on the suggestion in the question, I upgraded Expo to 2.22.1. But on opening my project in this version of expo I am getting below error.
Any leads here is really appreciated.
Error running xcrun simctl openurl booted exp://localhost:19000: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=60):
The operation couldn’t be completed. Operation timed out
Operation timed out.
Try resetting the cache of your iOS simulator, close Expo XDE and run it all again.
For resetting, go Hardware -> Erase all content and settings.
Error code: 60 can usually be solved with the simulator's reset, although your case may be different.
React Native App crashes if signed and released. Works fine in debug mode. It doesn't throw any error in the screen. It simply crashes. When I looked at cat log. no error.
I also tried build apk with --info, but no additional info while crashing. I also tried building APK by setting minifyEnabled false.
When run the app in debug mode by connecting my phone via USB, it works.
I'm tried creating apk with --debug but I'm unable to install it my phone, it says parsing error when I try to install using app installer.
I got the following logcat errors. What does it mean?
09-03 11:03:07.968 W/ActivityManager(1344): Force finishing activity com.myapp/.MainActivity
09-03 11:03:08.012 W/BroadcastQueue(1344): Skipping deliver [background] BroadcastRecord{cb72147 u-1 android.net.conn.CONNECTIVITY_CHANGE} to ReceiverList{7bf2161 22421 com.myapp/10100/u0 remote:b9cdcc8}: process crashing
09-03 11:03:08.035 W/ActivityManager(1344): Dismiss app error dialog : com.myapp
09-03 11:03:13.095 I/WindowState(1344): WIN DEATH: Window{3f22c22 u0 /com.myapp.MainActivity}
I finally found the cause. There is module called react-native-material-design-searchbar which was causing the issue. The weird part is, if directly copy the SearchBar.js from that module and use it all works fine even in release, but if use module as direct import it's not working only in release mode. So weird. The SearchBar is good, so now I'm using directly by copying the file to my project.
I fixed this error by uninstalling uglifyjs and reinstalled the latest (using NPM).