React Native Debugging

Feb. 20, 2017

Bumble through guide on Facebook website. Start trying to add sensor stuff. Sensor stuff doesn’t work in simulator. Maybe it’ll work on the phone?

Ok, let’s try hooking up the phone. The sensor api I’m using’s stuff is throwing errors. I use this guy because those other two just support ios or just support android. Pray this one JustWorksTM so I don’t have to wrap it myself.

Named exports don’t work with this library. The properties are conveniently available if I shove it into a single variable and then extract it. Probably some ES6 default hijinks or something that I’ll probably try to do correctly later.

Compiles. Trying to use the sensor throws errors. Probably need to run this on the phone with real sensor data? Try to run on a phone. Bajillion errors, including from the native modules for this library.

Let’s comment it out for now and see if I can get the vanilla app running. It runs fine on the Xcode simulator (let’s ignore all this other stuff about some deprecated Objective C, it’s not breaking things). On the phone, errors galore about signing the app.

Sign up for a developer account on Apple. Try to remember my Apple id and password. Go into my gmail to try to find if, yes, it really is my email that is the id. Successfully guess password.

Figure out how to update the signing information by looking at Stack Overflow which has screenshots. Try to keep it automatic though. That error is gone! But now it complains that the unit tests section or something aren’t signed. I think they are? Go on Stack Overflow again and disable running the unit tests in the build for now.

No more errors?

Could not launch YourAppHere.

Verify the Developer App certificate for your account is trusted on your device. Open Settings on iPhone and navigate to General -> Device Management, then select your Developer App certificate to trust it.

Instructions work. Holy cow the app loads.


Try to figure out why this duplicate interface error gets thrown. Realize React Native 0.40.0 totally broke peoples stuff. Created project in 0.41.2 and module on npm (1.0.0) assumes < 40.0. Feel momentary confusion as the repo is using the React/RCTbla structure and says 1.0.0 is for >= 0.40.0.

Realize that master and an unpublished 2.0.0? thing support >= 40. Reyarnify. Oh woah, get some sensor readings. Except they never update after the initial reading. Stare at Objective C.

Oh look, there’s an example project with this module. Try to get it to work. It doesn’t in < 40.0 nor >= 40.0 with appropriate mangling of versioning. Contemplate whether this is worth it. Try another day.