{"record":{"id":"6a584f133224fe1f","repo":"asLody/VirtualApp","slug":"can-not-found-the-ipc-method","errorCode":null,"errorMessage":"Can not found the ipc method : ","messagePattern":"Can not found the ipc method : ","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"VirtualApp/lib/src/main/java/com/lody/virtual/helper/ipcbus/IPCInvocationBridge.java","lineNumber":25,"sourceCode":"\n/**\n * @author Lody\n */\npublic class IPCInvocationBridge implements InvocationHandler {\n\n    private ServerInterface serverInterface;\n    private IBinder binder;\n\n    public IPCInvocationBridge(ServerInterface serverInterface, IBinder binder) {\n        this.serverInterface = serverInterface;\n        this.binder = binder;\n    }\n\n    @Override\n    public Object invoke(Object o, Method method, Object[] args) throws Throwable {\n        IPCMethod ipcMethod = serverInterface.getIPCMethod(method);\n        if (ipcMethod == null) {\n            throw new IllegalStateException(\"Can not found the ipc method : \" + method.getDeclaringClass().getName() + \"@\" +  method.getName());\n        }\n        return ipcMethod.callRemote(binder, args);\n    }\n}\n","sourceCodeStart":7,"sourceCodeEnd":30,"githubUrl":"https://github.com/asLody/VirtualApp/blob/666fefcb5d3f39cc944001c3457c38ffd6544c87/VirtualApp/lib/src/main/java/com/lody/virtual/helper/ipcbus/IPCInvocationBridge.java#L7-L30","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Register the full interface class with IPCBus.register(Iface.class, impl) in the server process before clients call it","Ensure both processes use the same version of the interface class and disable obfuscation for it (proguard keep rules)","Verify the exact method name/signature exists on the interface passed to IPCBus.get"],"exampleFix":"// before\nIUserService svc = IPCBus.get(IUserService.class);\nsvc.getLoginAccounts(); // method not registered on server\n// after\n// in server process init:\nIPCBus.register(IUserService.class, new UserServiceImpl()); // implements ALL methods\nIUserService svc = IPCBus.get(IUserService.class);","handlingStrategy":"validation","validationCode":"// ensure all interface methods are registered server-side before clients call\nIPCBus.register(IUserService.class, new UserServiceImpl()); // impl must implement every method","typeGuard":null,"tryCatchPattern":"try {\n    return IPCBus.get(IUserService.class).getLoginAccounts();\n} catch (IllegalStateException e) {\n    if (e.getMessage().startsWith(\"Can not found the ipc method\")) {\n        throw new IllegalStateException(\"server does not implement IUserService.\" + methodName, e);\n    }\n    throw e;\n}","preventionTips":["Register the full interface implementation, not a subset","Use identical interface versions in both processes","Add proguard keep rules for IPC interface packages"],"tags":["android","ipc","method-not-registered","reflection"],"backgroundTag":"method-not-implemented","analyzedSha":"666fefcb5d3f39cc944001c3457c38ffd6544c87","analyzedAt":"2026-09-09T11:09:01.694Z","contentChangedAt":"2026-09-09T11:09:01.694Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}