Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloading fails often in android 10. #965

Open
shrutgyan opened this issue Jul 13, 2024 · 2 comments
Open

Downloading fails often in android 10. #965

shrutgyan opened this issue Jul 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@shrutgyan
Copy link

shrutgyan commented Jul 13, 2024

Everytime I try to download using flutter downloader package.

Always this error shows up in the condole.
"D/DownloadWorker( 2768): Update too frequently!!!!, but it is the final update, we should sleep a second to ensure the update call can be processed
"

This is how my downloadCallBack function looks like.

@pragma('vm:entry-point')
static void downloadCallback(String id, int status, int progress) {
print(
'Background Isolate Callback: task ($id) is in status ($status) and process ($progress)');
final SendPort? send =
IsolateNameServer.lookupPortByName('downloader_send_port');
send?.send([id, status, progress]);
}

and this function, I have called it in the initState().

void _bindBackgroundIsolate() {
IsolateNameServer.registerPortWithName(
port.sendPort, 'downloader_send_port');
port.listen((dynamic data) {
// String id = data[0];
status = data[1];
progress = data[2];
setState(() {});
});
}

@shrutgyan shrutgyan added the bug Something isn't working label Jul 13, 2024
@shrutgyan shrutgyan changed the title Downloading fails often in android 10. Downloading fails often in android 10. Jul 13, 2024
@bettkipronoh
Copy link

Facing same issue

@huzaifasaeed
Copy link

Update this in android manifest:

     <provider
        android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
        android:authorities="${applicationId}.flutter_downloader.provider"
        android:exported="false"
        android:grantUriPermissions="true"
        android:requestLegacyExternalStorage="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/provider_paths"/>
    </provider>

    <provider
    android:name="androidx.startup.InitializationProvider"
    android:authorities="${applicationId}.androidx-startup"
    tools:node="remove" />

    <provider
        android:name="androidx.work.impl.WorkManagerInitializer"
        android:authorities="${applicationId}.workmanager-init"
        android:enabled="false"
        android:exported="false" />

    <provider
        android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
        android:authorities="${applicationId}.flutter-downloader-init"
        android:exported="false">
        <meta-data
            android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
            android:value="5" />
    </provider>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants