React-native rage quit

Disclaimer: to all those who love react-native and sing its praises, I’m clearly an impatient idiot and not worthy of its “magical experience”. In my defence, I have a 4 month year old child who demands 90% of my daily attention. When I get an hour spare to write some code, I expect to write some code! And not faff with configuration files I don’t understand or following instructions which lead me to failure.


What happened

Running a bare bones project in iOS was pretty straightforward. It all went wrong when I tried to integrate Firebase.

Googling around I found this library: https://rnfirebase.io which promises to get me

up and running with React Native Firebase in no time

Excellent.

At this point I followed the manual installation guide. This lead me into a world of cacaopods, plist files and a discovery that yarn and npm cannot be used at the same time on the same project.

I dutifully followed all the steps as well as I could (NB for iOS only at this point):

  1. Yarn installing the dependency
  2. Generating a plist file from Google
    1. Which I needed the iOS artifact ID for. As I had no idea where to find that, I scrambled around in XCode for a while and found it. Changing it in Xcode appeared to change no files that I could see, but I was in full trust mode of magic by this point.
  3. Realising that this library doesn’t do much of the heavy lifting I expected it to and if I wanted Google authentication for example, I need to install another separate library to actually do the authentication and pass the token to rn-firebase, which I dutifully did.

That all done, I run: react-native run-ios and… Fail! Getting some errors about duplicate react-native libraries.

Argh, all I’ve done is follow the steps on a blank project and now I’m getting errors I don’t really understand.

Googling the error I find: https://github.com/react-native-community/react-native-google-signin/issues/482 which describes nearly exactly what I found. Phew, at least it isn’t just me! There are listed some more complicated steps to manually fix this, following two more guides which seem to link perpetually to other guides… But I’ve had enough.

In a fit of tech rage, I cd out of the project, rm -rf and Google how to get started with Cordova instead. Maybe I’ll try react-native again, I see there’s an example project fully configured that I can fork. But with so magic and so little understanding, I’m bound to run face first into brick walls again.

Final comments

You may be thinking that this is a whiney post. Or thinking, he didn’t try X, y, z or give it a chance, etc etc.

But when I look around the internet for guides or blogs on these frameworks I only see the success stories. “Oh it’s wonderful” or “how to get started in 10 easy steps”. None of them relate to the pains you get installing them, or that the 10 steps doesn’t include 50 steps setting up android and/or iOS (oh you wanted it to run on mobile did you?).

Maybe they don’t think people will like to read the ugly truths. Or maybe they feel that they will look tech stupid by saying how they failed.

I write java, JavaScript and clojure at work, so consider myself at least tech competent and I don’t mind saying: I tried it, I didn’t understand it and it didn’t work.

So, this blog is my experience of trying it, expecting it to work within a couple of hours and not hiding the ugly warts of frameworks and no doubt mobile development in general.

Surely it shouldn’t be this hard?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.