React Native project version upgrade error: v0.56 to v0.60, iOS fails - ios

I'm currently upgrading one of my projects built in React Native v0.56 to latest v0.60. Created a new project with version v0.60 and updated all the packages used in previous version of app, but now facing weird errors.
I've already tried all the possible solutions mentioned in Git and Stack overflow. None of them worked for me. I've also tried to remove plugins one by one and then adding them but not able to find cause of the error.
iOS:
In iOS, all the packages by default autolinks as per v0.60, but I got error of linking in very first package, I've tried manual linking too, not working.

After manual linking do cd ios and then pod install. This will not be done by autolinking and you have to do it yourself. On iOS on my project i had to manual link on iOS almost every library and almost all of them needed a pod install

use upgrade helper from react native community Upgrade Helper

Related

Ionic app loads using Ionic serve but not with Xcode

I'm currently stuck on a problem related to my Ionic project.
I have an Ionic project on GitHub which i've been working on in the past few weeks, i have a few Cordova plugins as part of the project.
When downloading the project from GitHub, i can run the app using Ionic Serve without a problem. However, when trying to setup the project for xCode to run on local device(s), i run into a multitude of errors
Some include:
When running ionic 'cordova platform add ios' the following error appears
Error: Could not install from "ios" as it does not contain a package.json file.
When trying to run 'ionic cordova run ios -l --external'
Error: Error: terminating with uncaught exception of type NSException
I have not yet tried to transfer my code into a new Ionic project, as i wish to see if my problem can be solved without that hassle.
View project code here: https://github.com/designsheikh/bitsandbobs.git
I figured it out. You have the exact same issue I've had with the android platform.
As I pointed it out in the comments, it is indeed caused by a "corrupted" project architecture.
How it happened
Initially, I had an issue with the cordova generated resources, somehow not being copied into the android platform directory. I tried plenty of things with the cordova-res CLI, including using the --copy and the --ios-project flags to force the copy to happen in the directory of my choice.
I couldn't manage to fix my issue, and then decided to rollback all my changes and start over on a clean project to try something else. Since then, I was not able to add the android platform anymore. Every single time, the following error was being thrown :
Error: Could not install from "android" as it does not contain a package.json file.
Explanation
With all my testing, I noticed that when using cordova to add the platform or copy the resources over, somehow, it had created the android platform in the wrong directory, at the root of my project instead of in the platforms folder. And that's where the issue comes from.
I can't explain it, but you will encounter this error every single time if you try to add a platform with cordova while having a folder with this platform name at the root of your project. I have no idea why this would prevent a platform from being added to the project, maybe this folder is used as a temp folder by the CLI.
Solution
The fix is to simply remove any ios or android directory at the root of your project.
The error will go away and you will be able to add the platform again.
#CodingJunkie
Regarding the Github repository you provided in your post, you will likely run into another error while trying to add the ios platform if you use cordova#>=9.0.0.
Using "requireCordovaModule" to load non-cordova module "xcode" is not supported.
Instead, add this module to your dependencies and use regular "require" to load it.
Check this issue#1033 for a workaround. However, it's not recommended to directly edit the plugin source code, you might want to look for another cordova Firebase plugin.
I also noticed you kinda mixed up cordova and capacitor in your project.
Make sure to use one or the other to avoid potential errors.
Hope this helped !
#Reqven
Thank you for your support! - i was sure that i had done this step while trying to fix the issue. It is such an absurd problem, it seems that there is a new project architecture as you mentioned which needs to be followed. I followed your steps with also one minor additional step as im working on the iIOS platform:
Delete iOS folder
cordova platform add ios
cordova prepare ios
ionic build
If step 2 throws an error causing the version not to be found or integrated into the project run - include '#latest' this also solved my problem

expo invariant violation rncsafeareaprovider error on ios

I have developed an app with react native using expo. I published the app to expo and it is working fine with android but it is giving error on ios. On some digging I also tried to install react-native-webview but that also did not work. How I can fix this problem.
There is a possibility that when you were installing other dependencies, you have duplicated react-native-safe-area-context. For example, if you have installed #react-native-community/masked-view or some other package containing this you can get this error. You simply have to remove the duplicate.
rm -rf node_modules/expo/node_modules/react-native-safe-area-context is one solution.
But remove the module you absolutely don't want.

Upgrading React Native plugin to support autolinking and React Native versions 0.6>=

I am fairly new to React Native but am helping manage a React Native plugin and would like some guidance for upgrading it so that it is compatible with auto linking and React Native versions 0.60 and up in iOS.
Our plugin currently only works with React Native up to and including 0.59.x through the react-native link command and sometimes involves manually dragging our xcodeproj and .a binary inside Xcode.
When trying to instrument our plugin with a blank hello world React Native app of version 0.60.5, after react-native link and dragging in Xcode, we get an error saying rctbridgemodule.h not found and have to add React.xcodeproj too. This however doesn’t work on some apps we’ve tried. Furthermore the issue is in newer versions of React eg 0.61.4, the React.xcodeproj file is no longer in the React folder in node_modules. 

I’ve had a look at the What do I need to have in my package to make it work? Section in this link: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
But to me its not very clear how we should be configuring a pod spec in the root of our repo. Our package is scoped also. I’m assuming that there shouldn’t need to be any changes to the actual code of our plugin but rather just some modifications to our pod spec and package configuration. Any guidance in how this works and how to upgrade our plugin to support versions 0.6 and above would be greatly appreciated. Thanks!

Error message - RNFirebase core module was not found natively on iOS

React Native Firebase won’t install on iOS React Native project. It works fine on Android.
I followed this instruction.
https://rnfirebase.io/docs/v5.x.x/installation/initial-setup
I set up Firebase, added the downloaded plist file via XCode, installed and set up Cocoapod.
The moment I add the following line to my App.js, the simulator returns an error message.
import firebase from 'react-native-firebase';
The error message: “RNFirebase core module was not found natively on iOS”
I’ve tried a few things I picked up from this forum:
https://github.com/invertase/react-native-firebase/issues/614
I commented out following lines from Podfile
use_frameworks!
And then pod install, pod update
on Xcode, checked the Build Phases/ Link Binary with Libraries section. I checked libRNFirebase.a was already there.
I've been trying this for a few months now on and off. And I haven't found a way to make React Native Firebase install on iOS project. Any pointer would be much appreciated.
I'm currently maintaining the react-native-firebase v5 branch (current stable) and we do have a problem with the header search paths right now for some reason.
I don't have a definitive fix, but I constructed a demo that goes from react-native init, then installs react-native-firebase, and does all the things necessary such that the project builds and runs on iOS and even archives in release mode.
You may see it here: https://github.com/mikehardy/rnfbdemo
The only thing that is important at the moment is that you need to put one non-documented thing in your Podfile after following all the install instructions, as the last line before the final end
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")

Gstreamer 1.0 ios sdk installer failed to install

This is my first time trying with Gstreamer for ios , I went with the tutorial and installed the SDK with the link provided by the tutorial:
http://docs.gstreamer.com/display/GstSDK/Installing+for+iOS+development
The installation works fine, but after I start trying the tutorial example projects, there couple of compiling errors compiling about missing gst/video/videooverlay.h . Then I looked into the header folder under the installed GStreamer header folder, there is no filed called video/videooverlay.h
Then I search online, found this information:
Gstreamer for iOS provided is out of date. I used the freedesktop packages
from https://github.com/braincorp/gstreamer_ios_tutorial
Then I downloaded another installation pkg for GStreamer
Then while I was trying to install the later version, the installer give me error saying:
you cannot install GStreamer 1.0 (Development Files) in this location.
Then I thought I might need to uninstall the previous version, but I couldn't finder a standard uninstallation option from the installer, then I searched online, find one post suggest remove the GStreamer folder under ~/Library/Developer
I have removed the installed folder, so I don't have any header files, but the new installer still gives the same error
I have been trying to figure this out for sometime, couldn't find useful info on line , I really appreicate any clue and help you might have!
Thanks!!
Jing
Answering my own question here..
not sure what's the issue, after restarting my mac, and run the installer couple of times with the same error, it suddenly worked ....... i am not sure what's the matter here, hope gstreamer team can improve the stability of the installer in the future.
At work we are currently trying to get the IOS tutorials from the streamer 1.0 sdk to run.
1) Compilation: Same thing: we managed to bootstrap (cerbero ... bootstrap) and compile (cerebra ... package streamer-sdk) using the official cerebero git repository.
But:
a) We had to mock around with the /cerbero/cerbero/enums.py file:
Add in the collection of supported old IOS (6.0, 6.1, 7.0, etc...) the one corresponding to our Xcode version : IOS 8.4
b) We had to customize the /cerbero/config/ios.config and iOS-universal.config files to get them to use the right architecture in our case: arm7v or arm7 instead of X64_86 or x86
c) We removed the not found is_asm() function from the x264 plugin's recipe file in the /cerbero/recipes.
For a reason we ignore, for all other platforms but IOS, the recipes check on the architecture available using:
if self.config.target_arch == Architecture.xxx:
of iOS is was using that missing function: is_asm(self.config.target_arch)
We replaced it by:
if self.config.target_arch == Architecture.ARMv7:
Compiling an iOS app using streamer:
So far it is a failure. we bumped into the same missing overlay.h header file. We couldn't find it anywhere.
DIFFERENCE between gstreamer.com (the sdk provider) and the official streamer website (free desktop.gsteamer.org):
We found out that gstreamer.com is clearly a commercial goal company that is making available the sdk, that people struggle on with for IOS (tested and working fine on linux) and the official website is providing the gstreamer library only without an sdk.
So this is what we are trying to use instead as of today.
Versions infos:
sdk (from gstreamer.com): current cerbero git master branch: git clone git://anongit.freedesktop.org/gstreamer-sdk/cerbero
official gstreamer library:
http://gstreamer.freedesktop.org/data/pkg/ios/1.5.2/

Resources