Exact steps needed to migrate a react native android app to iOS - ios

I've written a react-native app and compiled it for android.
Now I wish to compile my app for iOS.
I've searched the internet and found a lot of documentation about adding react-native components to an existing iOS app project, but couldn't find a concrete guide/explanation on how to take an existing react-native project(with many components, packages installed etc) and add the relevant iOS configuration.
I guess that I somehow should create an iOS project through xCode,then probably copy some project files into my ios folder of my project, create a podfile corresponding to my packages in package.json, install the required stuff using pod install and then maybe I can run it using the react-native run-ios command, but I'm really not sure whether I'm correct and to do these steps.
If someone can clarify to me what are the required steps I'll be grateful! (And I think other people might find it useful as well)

Related

How to build a working existing react native app on iOS?

So I have an app that I have been working on for a far few months now. I developed it on Ubuntu and tested on my android phone and tablet. The app is setup using the basic react native library and I also added in expo later on for some little thing expo had that I needed. Let me know if you need more information about this.
The app is 'feature complete' and just needs to be play tested and released. So naturally I need to get it up and running on iOS. I am currently renting a mac that I can remote into (as I own no apple products).
It has been nearly a week now and I just cannot move past this error (see bottom) (or variations of what seem to be the same/similar errors). I can build a fresh app on this mac so everything is there to build react native apps. I have tried: Deleting pod and and running
pod install
running
pod deintegrate && pod install
deleting node modules and running
npm install
Initially I had an error complaining that some libraries were manually linked and this was bad so I unlinked them and now I get this error. I am opening that app using the workspace file when I run in xcode. I also get the error if running through command line i.e.
npx react-native run-ios
Using different simulators makes no difference...not sure if it is even getting that far in the build process for that to matter. I think this has something to do with the linking of RN libraries and this new auto link thing. Any thoughts? There are loads of posts with this error (or close to) that have all sorts of 'solutions', but none seem to make a difference. Overwhelmingly peoples solve this by pod install after deleting pod folder or running the pod deintegrate command. Looking at the error you can see that it prints out loads of libraries some of which I installed and others probably come with my 3rd party libraries, but some look like the core libraries and even low level looking ones that presumably RN is built on (but I honestly wouldn't know).
I was having issues before 'compiling' stuff and again I think it was to do with the linking.
Also, is there a 'react native' support service or something i.e. I pay some who knows apple and will just fix the damn thing for me
ERROR (scroll to the bottom for what is probably the important bit):
https://pastebin.com/HMdP4x3P
[EDIT]
I think this has something to do with my podfile: https://pastebin.com/5J7BbG2Q other pod files do not look like mine.

'FBSDKShareKit/FBSDKShareKit.h' file not found

I've made an IOS build on Unity for an App we're making after adding the facebook SDK, moved the build on a hard drive and tried to build it on xcode on the mac we have at the office, as I always do before uploading it to the app store. I ran into this error and I've been stuck on this issue for 2 full work days and it's driving me a bit crazy, here are the thing's I've tried:
-Install cocoapods, both on the default terminal directory and on the project's directory (I'm not too experienced with cocoapods so I don't know if that made a difference. I also did pod update while standing on the project directory).
-I saw that the IOS resolver has an option called "generate pod files" that people said needed to be checked when building to solve this issue. It was checked by default on my project, so that wasn't it.
-Added the framework path on the build settings to where the facebook SDK is at (though the way it looked on my xcode seemed a bit different than the way I've seen it on other people's xcode screenshots)
-Tried commenting out some #include lines on the headers that are generating the issue. It only produced more errors.
-People said to open the project from the workspace instead of the xcodeproject but unity doesn't seem to generate a workspace file.
-Tried downgrading the Facebook SDK to a previous version but the versions people claim are working don't seem to be on the repository anymore, so it doesn't let me downgrade to them.
At the moment I'm trying to make it work with the latest Facebook SDK which is 9.0.0.
Any help would be appreciated, please let me know if I'm not being specific enough about the issue or if there's any information about my project I should include on the post
The .xcworkspace should be created by Cocoapods, not by Unity directly.
If you already have the Podfile generated, just run pod install on the project directory and open the created .xcworkspace file after Cocoapods finishes installing the external dependencies.

Installing react-native-custom-segmented control, need to install ios framework to react-native project

I'm trying to install this: https://github.com/wix/react-native-custom-segmented-control into my react-native project.
In the installation instructions, it says to move the .xcodeproj file to my project folder. I dragged it to the root folder of my project (though I am not sure that is right).
Then the instructions say to add the libCustomSegmentedControl.a file to my target's library.
The project was initialized using expo and I don't think it has a xcode target project? I am confused as to how to proceed in installing this. Is there a secret place in a react-native app that I can find the xcode project?
I'm a beginner with ios so any help would be really appreciated!
If you created the project using expo then you need to eject it before you can install any module that expo doesn’t support.
You can find more info at this link.
https://docs.expo.io/versions/latest/expokit/eject
Expo doesn’t actually have an Xcode or Android project inside the code base, so you can’t add react-native-custom-segmented-control to an expo project.
This post does a good breakdown of the differences between creating a react-native project using expo or react-native init
https://stackoverflow.com/a/49324689/5508175

Why does my xcode project build on simulator but not device in xcode project?

I have a react native project that runs successfully on simulator but not on device.
I have run the project on the same device before, but not since I've incorporated cocoapods, though none of the above library are in cocoapods. I'm building in xcworkspace rather than a project file, not sure if that is it.
Not sure what this could be... Any suggestions appreciated!
Usually these type of errors appear when the libraries are not linked with the project.
The libraries might have been unlinked after adding cocoapods. Try running npm install and then react-native link to link all the libraries or run react-native link <library-name> to link the specific library in the terminal from your project root directory.

build TVOS Example App with React Native using github.com/douglowder/react-native-appletv build errors

I am new to development, I have followed instructions, downloaded a zip of the dev's project,unzip,cd to folder, ran npm install and npm start
In the example app folders when trying to build in Xcode I get numberous React/RCT{file} file not found and will highlight an invalid import statement such as #import
I have been chasing this issue around github for days, tried numerous fixes such as updating the schemes, making an extra cocopods file that references the libraries functions
Anyone have a solution to this referencing problem?
these kinds of errors
https://github.com/facebook/react-native/issues/13371
Frankly I mightnt even be installing the project folder correctly, I dont know
thanks

Resources