{"record":{"id":"072e729b868aa8b5","repo":"lingochamp/FileDownloader","slug":"fatal-exception-you-can-t-bind-the-filedownloadse","errorCode":null,"errorMessage":"Fatal-Exception: You can't bind the FileDownloadService in :filedownloader process.\n It's the invalid operation and is likely to cause unexpected problems.\n Maybe you want to use non-separate process mode for FileDownloader, More detail about non-separate mode, please move to wiki manually: https://github.com/lingochamp/FileDownloader/wiki/filedownloader.properties","messagePattern":"Fatal-Exception: You can't bind the FileDownloadService in :filedownloader process\\.\n It's the invalid operation and is likely to cause unexpected problems\\.\n Maybe you want to use non-separate process mode for FileDownloader, More detail about non-separate mode, please move to wiki manually: https://github\\.com/lingochamp/FileDownloader/wiki/filedownloader\\.properties","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/com/liulishuo/filedownloader/services/BaseFileServiceUIGuard.java","lineNumber":135,"sourceCode":"        FileDownloadEventPool.getImpl().\n                asyncPublishInNewThread(new DownloadServiceConnectChangedEvent(\n                        isLost ? DownloadServiceConnectChangedEvent.ConnectStatus.lost\n                                : DownloadServiceConnectChangedEvent.ConnectStatus.disconnected,\n                        serviceClass));\n    }\n\n    private final List<Context> bindContexts = new ArrayList<>();\n    private final ArrayList<Runnable> connectedRunnableList = new ArrayList<>();\n\n    @Override\n    public void bindStartByContext(final Context context) {\n        bindStartByContext(context, null);\n    }\n\n    @Override\n    public void bindStartByContext(final Context context, final Runnable connectedRunnable) {\n        if (FileDownloadUtils.isDownloaderProcess(context)) {\n            throw new IllegalStateException(\"Fatal-Exception: You can't bind the \"\n                    + \"FileDownloadService in :filedownloader process.\\n It's the invalid operation\"\n                    + \" and is likely to cause unexpected problems.\\n Maybe you want to use\"\n                    + \" non-separate process mode for FileDownloader, More detail about \"\n                    + \"non-separate mode, please move to wiki manually:\"\n                    + \" https://github.com/lingochamp/FileDownloader/wiki/filedownloader.properties\"\n            );\n        }\n\n        if (FileDownloadLog.NEED_LOG) {\n            FileDownloadLog.d(this, \"bindStartByContext %s\", context.getClass().getSimpleName());\n        }\n\n        Intent i = new Intent(context, serviceClass);\n        if (connectedRunnable != null) {\n            if (!connectedRunnableList.contains(connectedRunnable)) {\n                connectedRunnableList.add(connectedRunnable);\n            }\n        }","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/lingochamp/FileDownloader/blob/6237a8cac174bcc916e4342b14ab1ab72a5768d4/library/src/main/java/com/liulishuo/filedownloader/services/BaseFileServiceUIGuard.java#L117-L153","documentation":"Error \"Fatal-Exception: You can't bind the FileDownloadService in :filedownloader process.\n It's the invalid operation and is likely to cause unexpected problems.\n Maybe you want to use non-separate process mode for FileDownloader, More detail about non-separate mode, please move to wiki manually: https://github.com/lingochamp/FileDownloader/wiki/filedownloader.properties\" thrown in lingochamp/FileDownloader.","triggerScenarios":"Thrown at library/src/main/java/com/liulishuo/filedownloader/services/BaseFileServiceUIGuard.java:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Switch to non-separate process mode: do not set 'process.non-separate=true' in filedownloader.properties so the service runs in the host process","Do not call bindService/startService on FileDownloadService manually; use FileDownloader.get(context).bindService() or FileDownloader#start which handle binding correctly","If a separate download process is required, perform all FileDownloader API calls from the main process only and never bind from within :filedownloader"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6237a8cac174bcc916e4342b14ab1ab72a5768d4","analyzedAt":"2026-09-08T23:50:48.168Z","contentChangedAt":"2026-09-08T23:50:48.168Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}