asLody/VirtualApp · error · IllegalStateException

Can not found the ipc method :

Error message

Can not found the ipc method : 

What it means

IPCInvocationBridge.invoke resolves the invoked interface Method to a registered IPCMethod via serverInterface.getIPCMethod(method). When no matching method was registered for that interface, it throws this IllegalStateException naming class@method. It means the client called an interface method the server side never registered.

Solutions

  1. Register the full interface class with IPCBus.register(Iface.class, impl) in the server process before clients call it
  2. Ensure both processes use the same version of the interface class and disable obfuscation for it (proguard keep rules)
  3. Verify the exact method name/signature exists on the interface passed to IPCBus.get

Example fix

// before
IUserService svc = IPCBus.get(IUserService.class);
svc.getLoginAccounts(); // method not registered on server
// after
// in server process init:
IPCBus.register(IUserService.class, new UserServiceImpl()); // implements ALL methods
IUserService svc = IPCBus.get(IUserService.class);
Defensive patterns

Strategy: validation

Validate before calling

// ensure all interface methods are registered server-side before clients call
IPCBus.register(IUserService.class, new UserServiceImpl()); // impl must implement every method

Try / catch

try {
    return IPCBus.get(IUserService.class).getLoginAccounts();
} catch (IllegalStateException e) {
    if (e.getMessage().startsWith("Can not found the ipc method")) {
        throw new IllegalStateException("server does not implement IUserService." + methodName, e);
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling any method on an IPC proxy obtained from IPCBus.get(Iface.class) where Iface (or that specific method) was never registered with IPCBus.register on the server side, or interface signatures diverged between processes.

Common situations: Registering a subset of interface methods or a different interface version in the server process; proguard/R8 renaming methods so reflection lookup fails; stale dex/APK where one process has newer interface code than the other.

Related errors


AI-assisted analysis of asLody/VirtualApp@666fefcb5d (2026-09-09). Data as JSON: /api/errors/6a584f133224fe1f. Report an issue: GitHub.

Appendix: source

Thrown at VirtualApp/lib/src/main/java/com/lody/virtual/helper/ipcbus/IPCInvocationBridge.java:25

/**
 * @author Lody
 */
public class IPCInvocationBridge implements InvocationHandler {

    private ServerInterface serverInterface;
    private IBinder binder;

    public IPCInvocationBridge(ServerInterface serverInterface, IBinder binder) {
        this.serverInterface = serverInterface;
        this.binder = binder;
    }

    @Override
    public Object invoke(Object o, Method method, Object[] args) throws Throwable {
        IPCMethod ipcMethod = serverInterface.getIPCMethod(method);
        if (ipcMethod == null) {
            throw new IllegalStateException("Can not found the ipc method : " + method.getDeclaringClass().getName() + "@" +  method.getName());
        }
        return ipcMethod.callRemote(binder, args);
    }
}

View on GitHub (pinned to 666fefcb5d)