Troubleshooting Guide — Flutter Pitel VoIP SDK
Follow the primary integration guide first. For every issue, record the device model, OS version, SDK tag, build mode, and relevant sanitized logs. Never include SIP passwords, service-account JSON, APNs keys, or certificate private keys.
Package and build
flutter pub get cannot resolve the SDK
Check: the dependency name is flutter_pitel_voip_v2, the URL points to flutter-pitel-voip-sdk-v2, the selected ref is a tag that exists, and SSH access is granted.
Next: run ssh -T git@github.com, correct the repository/tag or request repository access, then retry flutter pub get. Confirm the error names the package expected by the new import package:flutter_pitel_voip_v2/flutter_pitel_voip_v2.dart.
iOS reports an unsupported architecture or PJSIP linker error
Check: the build target is an iOS device (arm64), deployment target is iOS 14+, CocoaPods installed the pod, and the workspace opened is ios/Runner.xcworkspace. The current binary does not contain iOS Simulator slices.
Next: run flutter pub get, pod install from ios/, and build for a physical device. Compare the host Podfile with the tested README settings. If the failure names a specific symbol, retain that complete linker error for SDK support; do not delete Pods or lockfiles as a first response.
Android reports a Gradle, Java, or Google Services error
Check: JDK 17, minSdk 24+, Kotlin JVM target 17, a compatible existing Gradle toolchain, and the Google Services plugin applied once. Confirm google-services.json contains the host applicationId.
Next: sync Gradle, inspect the Google Services task output for the selected app ID, and compare the project DSL with the Android README setup. Do not mix Kotlin DSL and Groovy plugin configuration.
Firebase or Portal app ID does not match the installed app
Check: Android applicationId against the Firebase Android client, Portal entry and PitelSettings.appId; on iOS check Runner's Bundle Identifier in Debug, Profile and Release against its Firebase and Portal entries. Separately confirm the Android custom service's Kotlin package and manifest class name point to the same class; that package may differ from applicationId.
Next: align the identifiers, download the matching Firebase app configuration again, and rebuild. See the Android push guide and example setup.
Push and incoming calls
Android does not receive a Pitel call push
Check: Firebase has the host applicationId, google-services.json is in android/app, the Google Services plugin processed it, and Android Studio's Merged Manifest has one MESSAGING_EVENT service. With the documented custom service, confirm the Pitel service and FlutterFire service are removed and Pitel payloads reach PitelClient.handleFCMMessage.
Next: use the Android-only data/high-priority test in the push walkthrough and inspect device logs. A successful FCM HTTP response proves only that FCM accepted the request; separately verify device delivery, native dispatch, SIP registration, and call setup. Normal background/OS-terminated behavior is distinct from a user force-stop.
Push setup or token acquisition fails during startup
Check: Firebase initialization, the correct Android applicationId/iOS bundle ID, platform Firebase config, and sanitized Firebase errors. Confirm the SDK listeners and app startup are not conditional on getToken() succeeding.
Next: keep the app usable, retry token acquisition after the transient error, and check push readiness separately from SIP registered. Verify a real incoming call after token setup.
Calls fail after permission was denied or revoked
Check: microphone permission and, on Android 13+, notification permission at startup, app resume and before calling. Android notification permission is needed for visible call notifications; microphone permission is needed for call audio.
Next: request permissions while the app is foregrounded, explain why they are needed, and then retry the call. Complete the prompt before testing incoming calls while backgrounded or locked.
Android does not show a full-screen incoming call
Check: incomingCallMode, the merged host manifest, USE_FULL_SCREEN_INTENT, Android special app access and current Play eligibility. notDeclared means the manifest permission is missing; the SDK AAR does not declare it for the host.
Next: if status is notDeclared, add the permission and rebuild/reinstall. If it is notGranted and the app qualifies, offer Settings from a user action and check the boolean result. Otherwise use IncomingCallMode.notification and verify its notification fallback. Follow the FSI guide.
Full-screen behavior changed after returning from Settings
Check: the current FSI status, not the value cached before opening Android Settings.
Next: query getFullScreenIntentStatus() again when the app resumes and update the UI. Keep the notification fallback available if access is denied or unavailable.
iOS does not receive a VoIP call push
Check: test on a physical iPhone; confirm Push Notifications and relevant calling Background Modes, Runner target membership for GoogleService-Info.plist, Firebase APNs .p8/Key ID/Team ID, Portal VoIP .p12 and service-account JSON, exact bundle ID, and PitelSettings.teamId.
Next: correct the credential at its destination and retry on device. Simulator Firebase Messaging callbacks do not prove PushKit VoIP delivery. See the iOS walkthrough and Portal guide.
Registration, calls, and audio
Registration remains connecting or notRegistered
Check: extension/password, SIP domain (host name, no https://), account-issued proxy URI and registrar port, matching app identifier, and network/DNS/VPN access. Register onRegistrationStateChanged before login().
Next: wait for the listener to emit registered; completion of login() only confirms the native login command returned. If it never registers, provide sanitized logs and ask the PBX administrator to confirm the account and network route.
Outgoing call fails or targets the wrong number
Check: the app is in registered, permissions are granted, and the destination is either the intended SIP URI or extension. A bare extension is formatted using saved domain and port.
Next: use sip:<extension>@<domain>:<port> to make the destination explicit, verify the account's registrar port with Pitel/PBX support, and inspect the call error/disconnect event.
No audio or one-way audio
Check: runtime microphone permission, iOS NSMicrophoneUsageDescription, selected audio route, and whether the problem occurs on Wi-Fi and mobile data.
Next: ask the PBX/network administrator to check SIP signaling, RTP firewall and NAT routing. Keep device logs sanitized.
Call ends unexpectedly
Check: PitelCallDisconnectedEvent.statusCode, reason, and cause, plus PBX signaling logs and the configured proxy/port.
Next: consult the SIP disconnect code reference and provide the relevant sanitized event values to support.
Token refresh does not restore push delivery
Check: Android custom service onNewToken calls PitelClient.saveFcmToken; on Android this currently stores the token but does not automatically re-register SIP. On iOS the bridge updates its token and may trigger re-registration. A completed Dart setFCMToken() Future is not a backend receipt.
Next: on Android, retain current login settings and call login(currentSettings) after any active call has ended and the registration listener is no longer connecting; then wait for registered. Do not overlap registration attempts or use autoLogin() as a token-refresh command. On iOS, retry setFCMToken() if needed and verify on a physical device. For both platforms, verify a real incoming call; token storage or Future completion alone is not backend acknowledgement.
Custom call UI returns to defaults after app restart
Check: whether the host restored the account with autoLogin() and whether it supplied a uiConfig.
Next: autoLogin() does not restore custom UI settings. If custom UI must persist, restore the host's account settings under its credential policy and call login() with the desired uiConfig.