react native for ios seems to include a library from a previous project - ios

So I am trying my first few tutorials with react native and therefore am still quite unfamiliar. I had followed this tutorial for using an npm camera in an IOS app. The camera worked find but I had to go an link this library for the camera. I tried it both the manual approach and rnpm. However, now I have a different tutorial on the go which I was messing around with prior to the camera one, and the simulator throws this error.
undefined is not an object (evaluating 'CameraManager.Aspect'), and further down there is also an error about a file which I know was only in my other tutorial(because I wrote it).
So this seems to me like xCode or the node modules for react are somehow still holding this code. I had previously added an entry to the header search paths under the projects build settings, but I looked at it and this path I needed for the camera is not there. So I don't know where this is coming in from.
I ran react-native run-ios on my project, and I tried cleaning the product in xcode and running from there. So far I haven't had very much luck figuring this out.

Ok so this was a simple human error on my behalf. I will post an answer to it anyhow as it might help some react-native beginners. So I had recently made the switch from linux to OSX, and when I started on there linux I had always run the packager for react native manually, and then I found out on OSX I can just run react-native run-ios in the root of the project and it starts another terminal window with the packager running.
The react-native packager was causing the issue. When I ran the react-native run-ios command the following day(didn't turn off my computer) the packager in the other window was forgotten about and I thought it be smart enough to kill that process and restart a new packager for the other project, but it didn't. Hopefully if anyone makes the same assumption you can save some time with this answer.

Related

Set up React Native project without using react-native-cli

So I'm learning React Native now, and I'm wondering how to set up an app manually, without using react-native-cli. The reason is that I want to set up app code within another project, but whenever I try to move code from a react-native-cli app to another folder containing other project code, I get build errors when running npx react-native run-ios (specifically, xcodebuild errors out with exit code 65). Actually, even if you create a project with react-native-cli and then just change the folder name you get the same build error.
I have template repos I use to start React projects, and I'd like to set one up for native projects, but it looks like it's not possible with the react-native-cli workflow. Is there another way to initialize a React Native project? I know the React docs have a section on integrating RN with existing native apps (https://facebook.github.io/react-native/docs/integration-with-existing-apps), but I don't have an existing native app, I'm starting a new one!
I have scoured the documentation and found nothing on this. Is there any way to find out what commands are run by react-native-cli? How can I set up my RN app from scratch?
EDIT: yes I have heard of Expo! It's all over the RN documentation. I'm asking about how to do the things that react-native init does, but with a more specialized/templated project structure.
As per latest react native documentation, the easiest way to get started is with Expo CLI. Expo is a set of tools built around React Native and, while it has many features, the most relevant feature for us right now is that it can get you writing a React Native app within minutes.
Expo also helps in testing app on phone via QR code.

Unity iOS support, installation failed

I am trying to use Unity to create an iOS app. I used Unity Hub to install Unity. I then opened Unity, went to File-Build Settings. I click on iOS, and it says "No iOS module loaded", so I clicked on the "Open Download page". I downloaded UnitySetup-iOS-Support-for-Editor-2018.4.7f1 and ran it. It looks like everything is going smoothly, and right at the end I get the message in the attached screen shot.
I have tried closing Xcode and Unity. I have tried restarting my computer. I have done several Google searches, but I haven't found anything that helps. Does anyone have any ideas?
I suspect the installation path got messed up.
You have to use the Unity Hub to install additional packages.
Go to Installs, click the 3 vertical dots and select Add Modules.
I had a similar problem with tvOS support and it seems that if you don’t have Unity installed to /Applications/Unity, installing addons will fail. (I had it in /Applications/Unity-2019.4.7f1.)
I moved my Unity to /Applications/Unity, installed the addon, and then moved Unity back.
The accepted answer did not work for me.
However, what did the job (Unity 2018, Unityhub 3.4.1) was copying the installed /Applications/Unity/PlaybackEngines to the current /Applications/Unity-[2018....]/PlaybackEngines

Submit an app created with create-react-native-app to the App Store (without XCode?)

Before, react-native 0.45, when you'd create a project, it would generate a XCode project file in the ios folder so that you can open it with XCode and use it to submit your app to the app store.
Since react-native 0.45, react native project are created with the create-react-native-app command and there is no xcode project anymore.
I read that you can "eject" to go back to the old style and get an XCode project. create-react-native-app is supposed to make everything easier, so I suppose there is a way to submit to the app store without ejecting that doesn't make the whole process much more painful than by using XCode.
To be clear: I understand that there are probably ways to submit to the app store without XCode, but aren't them much more painful? I can't believe that react-native would then consider it an improvement to not generate a XCode project anymore.
Could someone point me in the right direction?
Since react-native 0.45, react native project are created with the create-react-native-app command and there is no xcode project anymore.
This is incorrect. create-react-native-app is simply one of two ways to start a React Native project. The react-native init method of starting a project is still there in the docs.
To be clear: I understand that there are probably ways to submit to the app store without XCode, but aren't them much more painful? I can't believe that react-native would then consider it an improvement to not generate a XCode project anymore.
You are not going to get a good answer for this as it's very much down to opinion. StackOverflow is not the right place to ask such a question.
Could someone point me in the right direction?
Same with this question. Please read How to Ask to properly demonstrate what you've tried and exactly what issue you are running into.
As a starting point for learning how to publish, I suggest looking at the create-react-native-app documentation as it gives you two options right there:
Ejecting to generate the ios and android folders with which you can then publish.
Using a third party service like Expo to publish for you.
Their documentation goes a bit more into depth on the options. This is the best summary I can give as an answer without putting any of my opinions into it.

React Native - Packager not starting

I've been going through some React Native courses and storing all my apps in a 'projects' folder. Everything has been working fine, but all of a sudden I seem to be having some issues with the packager not automatically starting up when i run react-native run-ios while I'm in the specific project's folder. The simulator pops up, but it only shows my previous apps and doesn't contain the new one I just created with react-native init new-app. I've been searching around and I can't seem to find any solution to this. Any thoughts?
This is the last line showing in the terminal:
IDEDerivedDataPathOverride = /Users/[MY_USER]/Documents/projects/new-app/ios/build
So after some digging and testing, I realize the issue is tied to the new feature in Sierra that stores your files in iCloud Drive. Not sure exactly of the specifics, but the issue was resolved when I turned this feature off.

react-native integrating with existing ios apps

Have followed the instructions from here:
https://facebook.github.io/react-native/docs/embedded-app-ios.html#content
I am able to install required react sub specs and react spec with pod install
I was able to run the local react server to serve the bundles as well.
But I am seeing the following issues which is preventing my app from starting up in the iOS simulator.
/.../node_modules/react-native/React/Executors/RCTContextExecutor.m:560:7: Comparison of function 'JSGlobalContextSetName' not equal to a null pointer is always true
/.../node_modules/react-native/React/Base/RCTRootView.m:230:17: Method override for the designated initializer of the superclass '-initWithFrame:' not found
Can anybody help decyphering whats going on? Seems like it is specific to the RCTRootView implementation inside react library.
i figured the problem was with where i started the react-native app. It was not running from the project root. fixing that fixed the starting of the app in the simulator and these warnings werent the real root cause.

Resources