Troubleshooting
Resolve common React Native SDK integration issues and build errors
Troubleshooting
This guide covers the most common issues developers encounter when integrating StreamLayer into React Native applications.
Native Module Linking Failures
Symptoms:
- "Cannot find native module StreamLayer" runtime error
NativeModules.StreamLayeris undefined- Auto-linking appears to have run but module still missing
Solution:
- Clear all caches and rebuild:
cd ios && rm -rf Pods Podfile.lock cd .. && rm -rf node_modules && npm install - Verify auto-linking:
npx react-native configshould list StreamLayer - If auto-linking fails, manually link:
- iOS: Add StreamLayer to Podfile with
pod 'StreamLayer' - Android: Check
android/build.gradleincludes StreamLayer dependency
- iOS: Add StreamLayer to Podfile with
- Rebuild native code:
npm run androidornpm run ios - Clear app cache on device: Settings → Apps → YourApp → Storage → Clear Cache
iOS Pod Install Failures
Symptoms:
pod installfails with incompatibility errors- Pod cache corrupted after network interruption
- Xcode build fails with "Pods-YourApp" not found
Solution:
- Remove and reinstall pods:
cd ios && rm -rf Pods Podfile.lock && pod install - Update pod repo:
pod repo update - Check Xcode version—update if outdated
- Verify iOS deployment target matches in Podfile:
platform :ios, '12.0' - For M1 Macs, add architecture support:
post_installhook in Podfile
Android Build Failures
Symptoms:
- Gradle sync fails in Android Studio
- "Unsupported class-file format" errors
- Minimum SDK version conflicts
Solution:
- Verify Gradle and AGP versions:
// gradle/wrapper/gradle-wrapper.properties distributionUrl=https://services.gradle.org/gradle-8.0-bin.zip - Check
android/build.gradlecompileSdkVersion >= 33 - Ensure JDK 11+ is installed:
java -version - Clear Gradle cache:
rm -rf ~/.gradle/caches/ - Rebuild:
cd android && ./gradlew clean build
Metro Bundler Issues
Symptoms:
- Metro cache prevents bundler from seeing new native modules
- "Cannot find module streamlayer" during bundling
- Hot reload fails after dependency changes
Solution:
- Clear Metro cache:
npx react-native start --reset-cache - Kill old Metro processes:
lsof -i :8081 | grep node | awk '{print $2}' | xargs kill - Delete watchman cache:
watchman watch-del-all - For Expo projects, clear bundler cache and rebuild
- Restart Metro bundler after any native module changes
Expo-Specific Issues
Symptoms:
- StreamLayer not available in Expo managed workflow
- "Expo Go doesn't support this module" message
- Bare workflow works but managed doesn't
Solution:
- Confirm project is running bare workflow—StreamLayer requires it
- If using managed workflow, eject to bare:
expo prebuild --clean - After ejecting, follow iOS and Android troubleshooting guides
- Verify
eas.jsonincludes StreamLayer in plugins if using EAS build - Test locally with
npm run iosandnpm run androidbefore EAS builds
Still Need Help?
If you've tried these solutions and still encounter issues, contact our support team at [email protected] with:
- Full error logs and stack traces
- React Native version and platform (Expo managed/bare, RN CLI)
- Node and npm versions (
node -v && npm -v)
Related
- Integration Guide — Full React Native SDK setup and configuration
- Getting Started — React Native SDK overview and quick-start path
Updated 21 days ago
