How to troubleshoot React Native build error? - react-native

Below you can see the output I get when I try to run npx react-native run-android. It suggests some options to try in order to further pinpoint the problem, however they don't work with the aforementioned command so I assume that they are related to a gradle (just an educated guess).
I know ZERO about gradle; I have just seen the name here and there and in the output shown below. So please keep that in mind when you answer. If I need to learn how to run some gradle command(s) directly, please be as verbose as possible in your answer.
The project was working fine just a bit ago, but I wanted the ability to force portrait mode for certain screens but without configuring my entire app to always have to stick to portrait mode. So I found what looked to be a solution in the react-native-orientation-locker module. I installed it with yarn and then proceeded to update files as directed: https://www.npmjs.com/package/react-native-orientation-locker.
After updating the appropriate files, I got an error that suggested axios was the problem. I uninstalled and reinstalled axios. After that didn't work, I proceeded to undo all the file changes I had just made. Then I uninstalled the react-native-orientation-locker module.
To my knowledge, I have undone everything I did between the time the project worked and stopped working.
Sadly, I had not put this into source control yet (a mistake I won't make again), so I can't revert.
Where to go from here?

Problems like this are hard to pin point. What you can do is open the android project in android studio and see the logs as the project is being assembled. I assume you do not have much knowledge about android either so you might need some senior resource to help you.
What I usually do in this case is open android studio and if I am lucky enough, it tells me which file has an issue and I go to the file and do what android studio suggests me. Some times it fixes the problem and sometimes it doesn't.
Another thing I would like to mention is that the documentation of the package you are using is important to follow. I assume you did that already but I would suggest to review it narrowly and closely.
Another guess I can tell you is try to go to your-project/android/build.gradle and over there, you'll see something like this in the start. The package you are using mentions something about target SDK 27. I think you should check that out too. May be it helps
Lastly I would say always use source control while working with react native. It can easily blow up at any time so you should always have a safety net to fallback to :)

Related

Outdated React Native Project

I posted this question yesterday, but apparently worded it badly, so I'm trying again.
I'm working on a project that had been closed for a couple of years and reopened. During that time, a large number of the included node_modules have gone out of support (or at least the versions being used), React Native has been updated several times, new rules came out for building iOS projects, etc. leaving the project in a pretty broken state.
The previous team that worked on the project didn't leave much in the way of documentation, and we're stuck figuring out the details on our own.
There are two of us on the UI development, and we're able to build the project as-is using all of the old components. However, as soon as we start upgrading anything, we run into conflicts.
I've spent a good bit of time (several different times combined) trying to find a way to get the upgrade started, but everything I've tried runs into conflicts.
For purposes of clarity, he problems that I encounter include:
npm reports ERESOLVE Unable to resolve dependency tree
many errors (hundreds) come out of the XCode build - version compatibility, not allowed to use deprecated components, legacy build system outdated, conflicting pointer assignments, etc
All tools need to be upgraded (Node, npm, Android Studio, Xcode, React, React Native, Gradle, etc
Is there somewhere I can find an article or tutorial or something with a step-by-step, repeatable process for creating a project from scratch and adding the required components in an orderly way so that I can upgrade the whole process at once?
Also, I know that a lot of open source projects support their products with paid services, but that doesn't appear to be the case with React Native as far as I can tell. Is there somewhere we can find a project / build expert to come in and work with us on this?
Any help would really be appreciated!
Thanks in advance!

Import of new play projects into IDEA via build.sbt hangs

I'm using the current release of the Play framework. After having created a new project via activator new foobar, I tried to import it into IntelliJ IDEA (with installed Scala plugin) by importing the project's build.sbt file.
IDEA/SBT then downloads the dependencies but is always stuck here (even after hours nothing happens):
SBT: [info] downloading http://repo1.maven.org/maven2/org/scalaz/scalaz-core...
Any help is appreciated.
I have not personally experienced that kind of hanging behavior, but here are a couple of thoughts.
I see that this library is about 1MB. (I'm not sure on the exact version, but I picked a recent one: http://repo1.maven.org/maven2/org/scalaz/scalaz-effect_2.11/7.1.0). Are you on an unusually slow connection? Others have reported the hanging when downloads are slowly taking place. See https://stackoverflow.com/a/12605068/2308858.
You can try clearing your ~/.ivy2/cache folder (this has fixed things for me before). If on Windows look for .ivy2/cache near your home folder.
I've noticed that sometimes SBT does not give insight into what it's doing, often because it is suppressing otherwise helpful output. Check out http://www.scala-sbt.org/0.13.5/docs/Howto/logging.html for some options on how to see more details or change the logging level.
Update: See second comment on original question for additional details.

webstorm bug? project pane missing, did i bump a hotkey?

I.T. gave me an upgrade to V5 and I can't see my directory listing.
Maybe I bumped a hotkey i don;t know about?
You can see a screengrab here http://dl.dropbox.com/u/23768853/help.jpg
I'm combing thru all the preferences but so far nothing, anyone know how to make it come back?
Fixed !
I.T. re-copied the application into the application folder and webstorm is working normally again.
Surprising to think that the application can run even after a corrupt install.

UIKit.h not found error

I made a single view app for the ipad, with a movie, webview and button, and I get this error when I try and run it. I have restarted the application, and reinstalled it, but nothing is working. This error keeps coming up in my MoviePlayer_Prefix.pch file. Can someone help me out?
I have had the same issue with being unable to compile project due to UIKit.h not being found + "unable to load standard library for target..."
The solution for me was very simple - to quit (CMD+Q) and relaunch Xcode. I have found out that with Xcode opened, macOS seems to have removed command line tools for Xcode because it was preparing for a update and relaunching Xcode triggered the "install additional components" update and it made the problem disappear.
Like Faul Textor said, most likely your XCode updated to 12.1 but your Command Line Tools didn't. You need to quit XCode completely and then start it again and you should get a pop-up saying "Install Additional Components"
Sorry, this should have been a comment to his reply but I cannot do that.
It sounds like you removed the UIKit.framework from your project at some point. Check if it is listed in your project navigator. If it's not there, go to your project in the project navigator pane, select your target, go to the build phases tab, click on link binary with libraries, hit the plus button, find the UIKit.framework there and add it to your project.
EDIT:
This answer suggests that there mayb be an issue with your framework search paths build setting. Check that out and if the path is empty and it still doesn't work, a re-install of Xcode would fix it, I think.
Just wanted to add my two cents on not making a dumb-ass mistake - came across this answer hoping to solve same problem.
Turns out I had written #import "<UIKit/UIKit.h>" instead of #import <UIKit/UIKit.h>.
Thought I would add in case someone else makes a simple mistake like me.

bootstrap server. Error in iPhone SDK

Can anyone help for the following ERROR:
Couldn't register com.india.XXX with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
here m using xcode 4.1 and i have same project folders in my local desk.
When ever i open multiple projects with the same name its showing the above error.
Thanks in advance.
Some of the fixes that the links Saif contain may work for some, but not for me.
I have a very simple solution without restarting that will usually get you through the day.
When you get this error, before you do anything else, build for the other device (if you are running a universal application).
When you build for the other device, it kind of "overwrites" the process that creates this error. Once the other device is up and running, immediately build for the device that created the error. This will work most if not all the time, and will save you time digging through the multitude of fixes you will find in the other links.
I tried almost all of the fixes found there and none of them worked in my case. This works, but you should check your appDelegate for any bugs in your willEnter/didEnter (and other related methods).