{"record":{"id":"3010cc2017b3b543","repo":"MuntashirAkon/AppManager","slug":"adb-pairing-failed","errorCode":null,"errorMessage":"ADB pairing failed","messagePattern":"ADB pairing failed","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/adb/AdbConnectionManager.java","lineNumber":89,"sourceCode":"    public static synchronized PairingSession getPairingSession() {\n        return sPairingSession;\n    }\n\n    public static synchronized void endPairingSession(@NonNull PairingSession session) {\n        if (sPairingSession == session) {\n            sPairingSession = null;\n        }\n    }\n\n    @WorkerThread\n    public void pairAndReport(@NonNull PairingSession session, @NonNull String host, int port,\n                              @NonNull String pairingCode) throws Exception {\n        try {\n            Future<Boolean> pairingTask = sPairingExecutor.submit(() -> pair(host, port, pairingCode));\n            try {\n                if (!awaitPairingAttempt(pairingTask, PAIRING_ATTEMPT_TIMEOUT_MILLIS,\n                        TimeUnit.MILLISECONDS)) {\n                    throw new IOException(\"ADB pairing failed\");\n                }\n            } catch (SocketTimeoutException | InterruptedException e) {\n                discardInstance(this);\n                throw e;\n            }\n            session.reportSuccess();\n        } catch (Exception e) {\n            Log.w(TAG, \"Pairing failed.\", e);\n            session.reportFailure(e);\n            throw e;\n        }\n    }\n\n    private static synchronized void discardInstance(@NonNull AdbConnectionManager instance) {\n        if (sInstance == instance) {\n            // The library serialises operations on each manager. Do not let a stuck pairing\n            // operation block every later ADB connection through the same instance.\n            sInstance = null;","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/adb/AdbConnectionManager.java#L71-L107","documentation":"pairAndReport() rethrows the failure of the ADB wireless-pairing task submitted to sPairingExecutor. The underlying pair(host, port, pairingCode) — an mDNS/TLS pairing handshake with the device — failed, commonly because the pairing code was wrong or expired, the port changed, or the device dropped the pairing socket. The generic catch converts any cause into this reported error.","triggerScenarios":"Thrown at app/src/main/java/io/github/muntashirakon/AppManager/adb/AdbConnectionManager.java:89 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ask the user to re-enter the pairing code and re-run pairing before the dialog expires","Confirm both devices are on the same Wi-Fi network and mDNS is reachable","Check the device's wireless debugging screen for the current port and retry","Log/inspect the underlying cause exception for TLS or IO specifics"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}