I’ve been very quiet lately, this is because I was solving problems, of course ;).
All about native modules.
Again this is not allaboutmadonna.com :):)
My last project for one of my customer involves a lot a native modules for iOS and Android. I’m using:
"appcenter": "1.12.2", "appcenter-analytics": "1.12.2", "appcenter-crashes": "1.12.2", "react-native-ble-plx": "^1.0.2", "react-native-charts-wrapper": "^0.5.0", "react-native-device-info": "^1.0.0",<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span> "react-native-side-menu": "^1.1.3", "react-native-splash-screen": "^3.2.0", "react-native-svg": "^9.2.4", "react-native-vector-icons": "^6.3.0",
I’ve been struggling with automatic integration methods:
- manual integration
Specifically for the iOS project.
Honestly there is room for improvements in the automatic methods. They are not bullet proof and running them more than once may lead to side effects. I even ended up loosing track of knowing which module was integrated with which method, because the recommended automatic method will vary from one project to another.
I may have installed modules with both, while trying to solve below problems. This is the price to pay when dealing with numerous modules and not writing down what was done. My fault.
We’re not in the ‘its just works’ mode for now.
So all the problems depicted below were all solved all at once following each module instructions regarding manual integration.
I also had to deal with a new version of React Native that brings 64-bit support on Android and a new versions 10.2 of XCode (which brings Swift 5). That has not helped.
All right, so what troubled me so far?
No more react native debug menu
I’ve seen a ton a questions on Stack Overflow about this problem and none of the proposed solutions were working for me.
Crash in react native bridge for some native module
I’ve opened an issue on GitHub but it has been closed without an answer. I don’t care anymore.
RCT_EXTERN_MODULE Swift modules broken in Xcode 10.2
That React Native one had weird side effect on my project. Vanished completely with manual integration.
Crash in release mode for react-native-side-menu
Again, I’ve opened an issue about that problem. Solved. Closed.
Class is implemented in both ‘…’ and ‘…’. One of the two will be used. Which one is undefined
I do not know how I ended up here, but I was having React Native classes implemented twice in my project. Gone.
My takeaways: I’m not going back to either automatic integration method.
On the dark side, this has been hard for me because all these malfunctions triggered distress that I was not able to share with someone else because I’m working remotely as a freelance. In those moments this is my body that processes my emotions and honestly I don’t like that at all.
But, on the bright side, this has had the benefit to make me better understand how integration works with Both Android Studio and XCode. Of course this is tedious and error prone, but even if I’m looking for ways to create value rapidly by not reinventing the wheel, I could spend some time learning new thinks.
Open Source Software is great actually when done correctly in your context.
By the way : I will soon integrate C++ code with react-native-djinni. So excited.