{"record":{"id":"6e8add5519209dec","repo":"lingochamp/FileDownloader","slug":"please-invoke-the-filedownloader-setup-before-us","errorCode":null,"errorMessage":"Please invoke the 'FileDownloader#setup' before using FileDownloader. If you want to register some components on FileDownloader please invoke the 'FileDownloader#setupOnApplicationOnCreate' on the 'Application#onCreate' first.","messagePattern":"Please invoke the 'FileDownloader#setup' before using FileDownloader\\. If you want to register some components on FileDownloader please invoke the 'FileDownloader#setupOnApplicationOnCreate' on the 'Application#onCreate' first\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadProperties.java","lineNumber":162,"sourceCode":"    public final boolean fileNonPreAllocation;\n    public final boolean broadcastCompleted;\n    public final boolean trialConnectionHeadMethod;\n\n    public static class HolderClass {\n        private static final FileDownloadProperties INSTANCE = new FileDownloadProperties();\n    }\n\n    public static FileDownloadProperties getImpl() {\n        return HolderClass.INSTANCE;\n    }\n\n    private static final String TRUE_STRING = \"true\";\n    private static final String FALSE_STRING = \"false\";\n\n    // init properties, normally consume <= 2ms\n    private FileDownloadProperties() {\n        if (FileDownloadHelper.getAppContext() == null) {\n            throw new IllegalStateException(\"Please invoke the 'FileDownloader#setup' before using \"\n                    + \"FileDownloader. If you want to register some components on FileDownloader \"\n                    + \"please invoke the 'FileDownloader#setupOnApplicationOnCreate' on the \"\n                    + \"'Application#onCreate' first.\");\n        }\n\n        final long start = System.currentTimeMillis();\n        String httpLenient = null;\n        String processNonSeparate = null;\n        String downloadMinProgressStep = null;\n        String downloadMinProgressTime = null;\n        String downloadMaxNetworkThreadCount = null;\n        String fileNonPreAllocation = null;\n        String broadcastCompleted = null;\n        String downloadTrialConnectionHeadMethod = null;\n\n        Properties p = new Properties();\n        InputStream inputStream = null;\n","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/lingochamp/FileDownloader/blob/6237a8cac174bcc916e4342b14ab1ab72a5768d4/library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadProperties.java#L144-L180","documentation":"Error \"Please invoke the 'FileDownloader#setup' before using FileDownloader. If you want to register some components on FileDownloader please invoke the 'FileDownloader#setupOnApplicationOnCreate' on the 'Application#onCreate' first.\" thrown in lingochamp/FileDownloader.","triggerScenarios":"Thrown at library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadProperties.java:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call FileDownloader.setup(context) (or FileDownloader.setupOnApplicationOnCreate(application)) once, e.g. in Application#onCreate, before any download call","When registering custom components (output stream, id generator, etc.), use FileDownloader.setupOnApplicationOnCreate in Application#onCreate first, then setup(context)","Avoid keeping the process alive with no Application#onCreate running: ensure setup runs in every process that uses 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"}