Native Crashes, 5-Theme Systems, and the Art of React Native Debugging
Just wrapped up session 2 on Lettalize, my React Native Expo app for document digitalization, and wow - what a ride. Sometimes the most valuable lessons come from the most frustrating bugs.
The Native Crash That Taught Me Everything
Picture this: I'm integrating AdMob SDK, feeling pretty good about my progress, when suddenly the app just... dies. Immediately. No Metro logs, no helpful error messages, just silent death.
After way too much head-scratching, I discovered the culprit: expo run:android doesn't regenerate the android/ folder after app.json changes. The fix? npx expo prebuild --clean && npx expo run:android --device. And for debugging these silent crashes: adb logcat -d -s "AndroidRuntime" is your best friend.
This is exactly the kind of gotcha that makes you want to document everything for future you.
Building a Proper Theme System
I decided to go all-out on theming and built a 5-theme system. Added Midnight (Indigo) and Ocean (Sky Blue) themes alongside the existing ones, and switched the default from 'system' to 'light' - sometimes you just need that clean starting point.
The appearance screen got a complete overhaul with proper color swatches showing both background and primary colors for each theme. There's something satisfying about seeing all your theme options laid out visually.
SDK Integration Dance
Got both RevenueCat and AdMob SDKs properly integrated. For RevenueCat, I went with a lazy-require approach in the layout with a placeholder guard - keeps things clean until you actually need the functionality.
AdMob was trickier (hence the crash adventure above), but now I've got banner ads working for the free tier with a nice 1500ms delay and proper state management.
The Infrastructure Stuff
Set up a proper secrets.ts file (gitignored, backed up to USB) with test/prod toggles. Centralized all the important keys - RevenueCat test keys, AdMob app IDs, AWS ARNs. It's not glamorous work, but having your configuration sorted early saves so much headache later.
Also migrated the scan screen away from hardcoded colors to use the proper theme system. It's amazing how much cleaner the code feels when everything flows through a consistent system.
What's Next
Next session I'm tackling the RevenueCat paywall screen. The foundation is there, now it's time to build the monetization flow that actually converts users.
These debugging sessions always remind me why I love build-in-public. Every crash, every "aha!" moment, every small win - it's all part of the journey. And hopefully, documenting the native crash debugging process saves someone else a few hours of frustration down the road.