{"record":{"id":"5224595ed4258b44","repo":"asLody/VirtualApp","slug":"unable-to-start-receiver-data-component-e-to","errorCode":null,"errorMessage":"Unable to start receiver ${data.component}: ${e.toString()}","messagePattern":"Unable to start receiver (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java","lineNumber":632,"sourceCode":"            if (!isBound()) {\n                bindApplication(data.component.getPackageName(), data.processName);\n            }\n            Context context = mInitialApplication.getBaseContext();\n            Context receiverContext = ContextImpl.getReceiverRestrictedContext.call(context);\n            String className = data.component.getClassName();\n            BroadcastReceiver receiver = (BroadcastReceiver) context.getClassLoader().loadClass(className).newInstance();\n            mirror.android.content.BroadcastReceiver.setPendingResult.call(receiver, result);\n            data.intent.setExtrasClassLoader(context.getClassLoader());\n            if (data.intent.getComponent() == null) {\n                data.intent.setComponent(data.component);\n            }\n            receiver.onReceive(receiverContext, data.intent);\n            if (mirror.android.content.BroadcastReceiver.getPendingResult.call(receiver) != null) {\n                result.finish();\n            }\n        } catch (Exception e) {\n            e.printStackTrace();\n            throw new RuntimeException(\n                    \"Unable to start receiver \" + data.component\n                            + \": \" + e.toString(), e);\n        }\n        VActivityManager.get().broadcastFinish(data.resultData);\n    }\n\n    @Override\n    public IBinder createProxyService(ComponentName component, IBinder binder) {\n        return ProxyServiceFactory.getProxyService(getCurrentApplication(), component, binder);\n    }\n\n    @Override\n    public String getDebugInfo() {\n        return \"process : \" + VirtualRuntime.getProcessName() + \"\\n\" +\n                \"initialPkg : \" + VirtualRuntime.getInitialPackageName() + \"\\n\" +\n                \"vuid : \" + vuid;\n    }\n","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/asLody/VirtualApp/blob/666fefcb5d3f39cc944001c3457c38ffd6544c87/VirtualApp/lib/src/main/java/com/lody/virtual/client/VClientImpl.java#L614-L650","documentation":"This RuntimeException is thrown when a BroadcastReceiver registered in the virtual environment throws inside its onReceive() callback. VClientImpl delivers the broadcast to the plugin receiver and, if onReceive raises an exception, wraps it as 'Unable to start receiver <component>'. The chained cause contains the actual plugin bug.","triggerScenarios":"A broadcast is dispatched to a plugin-registered receiver whose onReceive(Context, Intent) throws any Exception; data.component identifies the failing receiver.","commonSituations":"Plugin receiver assumes an Intent extra exists but it is missing; receiver does network/file I/O that fails; receiver references classes not present in the plugin classloader; system broadcast format changed across Android versions.","solutions":["Inspect the `caused by` stack trace to find the real exception inside onReceive","Null-check Intent extras and context state in the plugin receiver's onReceive","Wrap risky work in the receiver with try/catch or move it to a Service/JobScheduler","Verify the receiver's actions/categories match what the sender actually broadcasts"],"exampleFix":"// before\npublic void onReceive(Context c, Intent i) { String id = i.getStringExtra(\"id\").toUpperCase(); }\n// after\npublic void onReceive(Context c, Intent i) { String id = i.getStringExtra(\"id\"); if (id != null) { id = id.toUpperCase(); } }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { receiver.dispatch(...) } catch (RuntimeException e) { Log.e(TAG, \"receiver \" + component + \" failed: \" + e.getCause(), e.getCause()); }","preventionTips":["Null-check all Intent extras in receiver onReceive","Avoid long-running or I/O-heavy work inside onReceive (use goAsync or a Service)","Register only the exact actions your plugin handles"],"tags":["android","broadcast","receiver","plugin-crash"],"backgroundTag":"unexpected-api-response-shape","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"}