🛠 Troubleshooting Guide - Pitel VoIP React Native
This guide helps you resolve common integration and runtime issues when using the react-native-pitel-voip-v2 React Native package.
📱 Build & Compilation Issues
🍎 iOS
Issue: "Undefined symbols for architecture arm64" or PJSIP Linker Errors
Symptoms:
- Xcode build fails with linking errors referencing PJSIP symbols.
Solutions:
- Physical Device Only: The underlying PJSIP static libraries are configured for physical iOS devices. Always build and run on a real iPhone.
- Deploy Target: Open
ios/Podfileand verify that the minimum deployment target is set to14.0or higher:platform :ios, '14.0' - Re-install Pods:
cd ios
pod repo update
rm -rf Pods Podfile.lock
pod install
Issue: Command PhaseScriptExecution failed with a nonzero exit code
Symptoms:
- Xcode build fails during bundling stage with an error from Metro bundler about missing modules (e.g.
@babel/runtimeor local packages).
Solutions:
- Metro Configuration (Monorepo/Symlinks): If using a monorepo setup (like
pnpm), configure Metro to watch the root directory and find libraries properly. Updatemetro.config.jsto look like this:const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const path = require('path');
const root = path.resolve(__dirname, '..');
const config = {
watchFolders: [root],
resolver: {
nodeModulesPaths: [
path.resolve(__dirname, 'node_modules'),
path.resolve(root, 'node_modules'),
],
},
};
module.exports = mergeConfig(getDefaultConfig(__dirname), config); - Clear Metro Cache: Run the startup command with reset cache:
npm start -- --reset-cache
# or
yarn start --reset-cache
# or
pnpm start --reset-cache
🤖 Android
Issue: Gradle / Java version compatibility errors
Symptoms:
- Android build fails referencing SDK methods or class file version mismatch.
Solutions:
- JDK 17: Ensure your development environment uses Java 17 (standard for newer React Native versions).
- Min SDK Version: In
android/build.gradle(orandroid/app/build.gradle), verify that theminSdkVersionis set to24(Android 7.0) or higher:buildscript {
ext {
minSdkVersion = 24
}
}
🔔 Push Notification & Wakeup Issues
Issue: App doesn't wake up on incoming calls (Background / Terminated)
Checklist:
- Simulator Limitation: iOS VoIP Push notifications do not work on simulators. You must test on a physical iPhone.
- Xcode Capabilities: Open your project in Xcode and go to Signing & Capabilities:
- Verify that Push Notifications is enabled.
- Verify that Background Modes is checked with:
- Voice over IP
- Background fetch
- Remote notifications
- Pitel Portal Credentials:
- For iOS: Make sure the correct
.p12VoIP certificate and Firebase Service Account.jsonare uploaded. - For Android: Make sure the Firebase Service Account
.jsonis uploaded and matches your package name. - See the Pitel Portal Setup Guide for full configuration steps.
- For iOS: Make sure the correct
🎙 Audio Issues
Issue: No audio or one-way audio during calls
Solutions:
- Microphone Permission:
- iOS: Ensure you added the Microphone permission usage description in
ios/<YourAppName>/Info.plist:<key>NSMicrophoneUsageDescription</key>
<string>We need microphone access to make VoIP calls.</string> - Android: Ensure the microphone permission is declared in
android/app/src/main/AndroidManifest.xml:<uses-permission android:name="android.permission.RECORD_AUDIO" />
- iOS: Ensure you added the Microphone permission usage description in
- Network/NAT issues:
- VoIP connections can block audio if you are on restricted corporate WiFi networks or behind strict firewalls. Try switching to mobile data (4G/5G) to rule out NAT audio blocking.
🔐 Registration & Connection Issues
Issue: Registration Status stuck on "CONNECTING..." or "NOT REGISTERED"
Solutions:
- Check SIP Configuration:
- Double-check extension, password, domain, and port configurations.
- Ensure the domain does not contain a protocol prefix (e.g., use
sip.pitel.vninstead ofhttps://sip.pitel.vn).
- Network Connection:
- Ensure the device is connected to the internet.
- Try changing networks (WiFi to mobile data or vice versa).