Troubleshooting
Solutions for the most common issues when integrating Snapbug.
Chrome Extension pairing
"Failed to reach relay" — check the relay host URL in the extension popup; if you run a local relay, make sure it is up and reachable.
Room code shown but the device never connects
- Make sure the app really initialized the SDK (
Snapbug.start(this)on Android). - Check that the device has internet access to reach the relay.
- Room codes expire after about 5 minutes — press Connect again to get a fresh code.
Inspector tab is blank or slow to load — the Compose Wasm UI requires Chrome 116+; the first load initializes a Wasm bundle of roughly 14 MB and can take a few seconds.
Local service not detected — run snapbug status to confirm the service is running, and check that nothing blocks port 9090. The extension probes http://localhost:9090/api/status on startup.
Android build errors
resource xml/network_security_config ... not found
SDK 0.1.1 pointed the app at @xml/network_security_config but did not ship that file, so debug builds failed with this error. SDK 1.0.1 and later fix it: in a native Android or Flutter app, upgrade Snapbug. The current snapbug-react-native release on npm still brings SDK 0.1.1, so React Native apps need the file below.
If your AndroidManifest.xml already sets its own android:networkSecurityConfig, you are not affected: your value wins. Otherwise create android/app/src/debug/res/xml/network_security_config.xml (the debug source set only, so release is untouched):
<?xml version="1.0" encoding="utf-8"?>
<!-- Needed by Snapbug SDK 0.1.1 in debug builds; delete after upgrading Snapbug. -->
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
<domain includeSubdomains="true">127.0.0.1</domain>
</domain-config>
</network-security-config>This only allows plain-text traffic to the local inspector. Everything else keeps the platform defaults.
Duplicate class in the release build
A per-plugin Snapbug artifact (snapbug-okhttp-interceptor, snapbug-ktor-interceptor, snapbug-database-room, snapbug-analytics, …) was added next to the all-in-one ai.snapbug:snapbug. The all-in-one already contains those integrations, and in release the extra artifact lands next to its no-op twin. Remove it and keep only the snapbug / snapbug-no-op pair. In Flutter and React Native apps, do not add any ai.snapbug:* dependency at all.
Toolchain errors
requires … compileSdk 36, requires Android Gradle plugin 8.6.0 or incompatible version of Kotlin / incompatible Kotlin metadata version mean the app's toolchain is below the SDK's floor: compileSdk 36, Android Gradle plugin 8.6.0, Gradle 8.7, Kotlin Gradle plugin 2.2. Raise what is below the minimum instead of downgrading Snapbug.
Network Security Configuration
This section only applies to the direct localhost connection — the default Chrome Extension flow over WebRTC does not need it. The debug SDK already ships a network security config that allows cleartext to localhost and 127.0.0.1; you need the steps below only if your app sets its own android:networkSecurityConfig, which then wins.
Starting with Android 9 (API 28), cleartext (non-HTTPS) traffic is blocked by default. Since the Snapbug SDK communicates with the local service over localhost using cleartext HTTP and WebSocket, you need to explicitly allow it.
1. Create a Network Security Config file
Create res/xml/network_security_config.xml in your app module:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">127.0.0.1</domain>
</domain-config>
</network-security-config>2. Reference it in AndroidManifest.xml
<application
android:networkSecurityConfig="@xml/network_security_config"
... >
</application>Do not use cleartextTrafficPermitted="true" at the top level of the config. That would allow cleartext traffic to all domains, which is a security risk. Only allow it for localhost and 127.0.0.1.
If you already have a network_security_config.xml for other purposes (e.g., certificate pinning), just add the localhost and 127.0.0.1 domain entries to your existing file.
Debug-only configuration
If you want to restrict this to debug builds only, create separate manifest files:
src/debug/AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:networkSecurityConfig="@xml/network_security_config" />
</manifest>Place the network_security_config.xml file in src/debug/res/xml/ instead of src/main/res/xml/.
Device Not Detected (direct localhost connection)
If the local service or desktop app does not detect your device:
- Check ADB -- Run
adb devicesand verify your device is listed. - Check port forwarding -- Run
adb forward tcp:9023 tcp:9023andadb forward tcp:9024 tcp:9024. - Restart ADB -- Run
adb kill-server && adb start-server. - Check the app is running -- The SDK only connects when the app with Snapbug initialized is in the foreground.
iOS: the bubble never appears
SDK 0.1.1 attached the bubble only if a window scene already existed when Snapbug.start() ran, so starting from SwiftUI App.init() left it invisible. Current versions wait for the first scene — see iOS SDK → Initialization.
SDK Not Initializing
- Verify you called
Snapbug.start(this)in your launcherActivity'sonCreate(). - Check that you are using
debugImplementationfor the SDK andreleaseImplementationfor the no-op artifact — withreleaseImplementation("ai.snapbug:snapbug-no-op")in a release build the SDK intentionally does nothing.
Emulator Connection Issues
Emulators should connect automatically since they share localhost with the host machine. If not:
- Make sure the local service (or desktop app) is running before launching the emulator app.
- Try restarting the service:
snapbug stop && snapbug serve. - Check that no other process is using ports 9023 or 9024.
Wi-Fi Connection Not Working
When connecting over Wi-Fi:
- Both the device and the computer must be on the same network.
- Some corporate or guest networks block device-to-device communication. Try a different network or use USB instead.
- Verify the computer's local IP address is correct (use
ifconfigon macOS/Linux oripconfigon Windows).
ProGuard / R8 Issues
If you encounter issues with minified builds, add this to your ProGuard rules:
-keep class io.snapbug.sdk.** { *; }The no-op variant does not require ProGuard rules since it contains no code that needs to be preserved.