skylot/jadx · error · SmaliDebuggerException

Failed to init JDWP.

Error message

Failed to init JDWP.

What it means

Error "Failed to init JDWP." thrown in skylot/jadx.

Source

Thrown at jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java:635

		try {
			handShake(outputStream, inputStream);
			outputStream.write(JDWP.Suspend.encode().setPacketID(1).getBytes()); // suspend all threads
			Packet res = readPacket(inputStream);
			tryThrowError(res);
			if (res.isReplyPacket() && res.getID() == 1) {
				// get id sizes for decoding & encoding of jdwp packets.
				outputStream.write(JDWP.IDSizes.encode().setPacketID(1).getBytes());
				res = readPacket(inputStream);
				tryThrowError(res);
				if (res.isReplyPacket() && res.getID() == 1) {
					JDWP.IDSizes.IDSizesReplyData sizes = JDWP.IDSizes.decode(res.getBuf(), JDWP.PACKET_HEADER_SIZE);
					return new JDWP(sizes);
				}
			}
		} catch (IOException e) {
			throw new SmaliDebuggerException(e);
		}
		throw new SmaliDebuggerException("Failed to init JDWP.");
	}

	private static void handShake(OutputStream outputStream, InputStream inputStream) throws SmaliDebuggerException {
		byte[] buf;
		try {
			outputStream.write(JDWP.encodeHandShakePacket());
			buf = IOUtils.readNBytes(inputStream, 14);
		} catch (Exception e) {
			throw new SmaliDebuggerException("jdwp handshake failed", e);
		}
		if (buf == null || !JDWP.decodeHandShakePacket(buf)) {
			throw new SmaliDebuggerException("jdwp handshake bad reply");
		}
	}

	private MethodsWithGenericData getMethodBySig(long classID, String sig) {
		List<MethodsWithGenericData> methods = clsMethodMap.get(classID);
		if (methods != null) {

View on GitHub (pinned to e738a26571)

Solutions

  1. Verify the socket connection to the JDWP transport succeeded before initializing; include the underlying exception message in the thrown error.
  2. Ensure the JDWP handshake is performed on the correct forwarded port and that no other debugger is already attached to the process.

When it happens

Trigger: Thrown at jadx-gui/src/main/java/jadx/gui/device/debugger/SmaliDebugger.java:635 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/222fd7b27d07fa34. Report an issue: GitHub.