lingochamp/FileDownloader · error · IllegalAccessException
This value is used in the :filedownloader process, so set…
Error message
This value is used in the :filedownloader process, so set this value in your process is without effect. You can add 'process.non-separate=true' in 'filedownloader.properties' to share the main process to FileDownloadService. Or you can configure this value in 'filedownloader.properties' by 'download.min-progress-time'.
What it means
FileDownloadUtils.setMinProgressTime is a static global setter for the minimum progress callback interval, but the actual value is only consumed inside the dedicated ':filedownloader' process. If called from the main (non-downloader) process, the assignment would silently have no effect, so the library throws IllegalAccessException to warn the developer. It also points to the two supported ways to configure this value.
Solutions
- Move the setMinProgressTime call so it runs inside the :filedownloader process (e.g. in the Application class of the downloader process).
- Add 'process.non-separate=true' to filedownloader.properties so the main process IS the download process and the setter takes effect.
- Remove the programmatic call and configure the value declaratively via 'download.min-progress-time' in filedownloader.properties.
- If you only need the warning silenced, guard the call with FileDownloadUtils.isDownloaderProcess(context).
Example fix
// before (main process, throws) FileDownloader.getImpl().setMinProgressTime(2000); // after: filedownloader.properties process.non-separate=true download.min-progress-time=2000
Defensive patterns
Strategy: validation
Validate before calling
if (!FileDownloadUtils.isDownloaderProcess(context)) {
// skip programmatic setter, rely on filedownloader.properties
} else {
FileDownloader.getImpl().setMinProgressTime(2000);
} Try / catch
try {
FileDownloader.getImpl().setMinProgressTime(2000);
} catch (IllegalAccessException e) {
Log.w("FileDownloader", "min-progress-time must be set in :filedownloader process or properties", e);
} Prevention
- Configure download tuning exclusively through filedownloader.properties instead of static setters.
- Remember which process each piece of init code runs in when using FileDownloadService.
- Add a debug-time assert that setter calls happen only in the downloader process.
When it happens
Trigger: Calling FileDownloader.getImpl().setMinProgressTime(...) (which delegates to FileDownloadUtils.setMinProgressTime) while isDownloaderProcess(appContext) is false, i.e. from any process other than the :filedownloader service process.
Common situations: Apps that split downloads into a separate process via FileDownloadService (the default multi-process setup) but tune progress timing from Application.onCreate or an Activity in the main process; upgrading to a version that enforces process separation; copying tuning code between projects with different filedownloader.properties.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- This value is used in the :filedownloader process, so set…
- fetched length[ ] != content length[ ], range[ , ) offset[…
- listener must not be null!
- event must not be null!
- can't create the block complete message for id
AI-assisted analysis of lingochamp/FileDownloader@6237a8cac1 (2026-09-08).
Data as JSON: /api/errors/9aaa35bdafc680e3.
Report an issue: GitHub.
Appendix: source
Thrown at library/src/main/java/com/liulishuo/filedownloader/util/FileDownloadUtils.java:110
* @param minProgressTime The minimum millisecond interval in per time to sync to the file and
* the database.
* <p>
* Used for adjudging whether is time to sync the downloaded so far bytes
* to database and make sure sync the downloaded buffer to local file.
* <p/>
* More smaller more frequently, then download more slowly, but will more
* safer in scene of the process is killed unexpected.
* <p/>
* Default 2000, which follow the value in
* com.android.providers.downloads.Constants.
* @see com.liulishuo.filedownloader.download.DownloadStatusCallback#onProgress(long)
* @see #setMinProgressStep(int)
*/
public static void setMinProgressTime(long minProgressTime) throws IllegalAccessException {
if (isDownloaderProcess(FileDownloadHelper.getAppContext())) {
FileDownloadUtils.minProgressTime = minProgressTime;
} else {
throw new IllegalAccessException("This value is used in the :filedownloader process,"
+ " so set this value in your process is without effect. You can add "
+ "'process.non-separate=true' in 'filedownloader.properties' to share the main"
+ " process to FileDownloadService. Or you can configure this value in "
+ "'filedownloader.properties' by 'download.min-progress-time'.");
}
}
public static int getMinProgressStep() {
return minProgressStep;
}
public static long getMinProgressTime() {
return minProgressTime;
}
/**
* Checks whether the filename looks legitimate.
*/View on GitHub (pinned to 6237a8cac1)