Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android. Maintainer: @hnvn

Overview

Flutter Community: flutter_downloader

Flutter Downloader

pub package

A plugin for creating and managing download tasks. Supports iOS and Android.

This plugin is based on WorkManager in Android and NSURLSessionDownloadTask in iOS to run download task in background mode.

iOS integration

Required configuration:

Note: following steps requires to open your ios project in Xcode.

  • Enable background mode.

  • Add sqlite library.

  • Configure AppDelegate:

Objective-C:

/// AppDelegate.h
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : FlutterAppDelegate

@end
// AppDelegate.m
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include "FlutterDownloaderPlugin.h"

@implementation AppDelegate

void registerPlugins(NSObject<FlutterPluginRegistry>* registry) {   
  if (![registry hasPlugin:@"FlutterDownloaderPlugin"]) {
     [FlutterDownloaderPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterDownloaderPlugin"]];
  }
}

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GeneratedPluginRegistrant registerWithRegistry:self];
  [FlutterDownloaderPlugin setPluginRegistrantCallback:registerPlugins];
  // Override point for customization after application launch.
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

@end

Or Swift:

import UIKit
import Flutter
import flutter_downloader

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

private func registerPlugins(registry: FlutterPluginRegistry) { 
    if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
       FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
    }
}

Optional configuration:

  • Support HTTP request: if you want to download file with HTTP request, you need to disable Apple Transport Security (ATS) feature. There're two options:
  1. Disable ATS for a specific domain only: (add following codes to your Info.plist file)
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>www.yourserver.com</key>
    <dict>
      <!-- add this key to enable subdomains such as sub.yourserver.com -->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!-- add this key to allow standard HTTP requests, thus negating the ATS -->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!-- add this key to specify the minimum TLS version to accept -->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>
  1. Completely disable ATS: (add following codes to your Info.plist file)
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key><true/>
</dict>
  • Configure maximum number of concurrent tasks: the plugin allows 3 download tasks running at a moment by default (if you enqueue more than 3 tasks, there're only 3 tasks running, other tasks are put in pending state). You can change this number by adding following codes to your Info.plist file.
<!-- changes this number to configure the maximum number of concurrent tasks -->
<key>FDMaximumConcurrentTasks</key>
<integer>5</integer>
  • Localize notification messages: the plugin will send a notification message to notify user in case all files are downloaded while your application is not running in foreground. This message is English by default. You can localize this message by adding and localizing following message in Info.plist file. (you can find the detail of Info.plist localization in this link)
<key>FDAllFilesDownloadedMessage</key>
<string>All files have been downloaded</string>

Note:

  • This plugin only supports save files in NSDocumentDirectory

Android integration

Required configuration:

  • If your project is running on Flutter versions prior v1.12, have a look at this document to configure your Android project.

  • From Flutter v1.12 with Android v2 embedding there's no additional configurations required to work with background isolation in Android (but you need to setup your project properly. See upgrading pre 1.12 Android projects)

  • In order to handle click action on notification to open the downloaded file on Android, you need to add some additional configurations. Add the following codes to your AndroidManifest.xml:

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

Note:

  • You have to save your downloaded files in external storage (where the other applications have permission to read your files)
  • The downloaded files are only able to be opened if your device has at least an application that can read these file types (mp3, pdf, etc)

Optional configuration:

  • Configure maximum number of concurrent tasks: the plugin depends on WorkManager library and WorkManager depends on the number of available processor to configure the maximum number of tasks running at a moment. You can setup a fixed number for this configuration by adding following codes to your AndroidManifest.xml:
 <provider
     android:name="androidx.work.impl.WorkManagerInitializer"
     android:authorities="${applicationId}.workmanager-init"
     tools:node="remove" />

 <provider
     android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
     android:authorities="${applicationId}.flutter-downloader-init"
     android:exported="false">
     <!-- changes this number to configure the maximum number of concurrent tasks -->
     <meta-data
         android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
         android:value="5" />
 </provider>
  • Localize notification messages: you can localize notification messages of download progress by localizing following messages. (you can find the detail of string localization in Android in this link)
<string name="flutter_downloader_notification_started">Download started</string>
<string name="flutter_downloader_notification_in_progress">Download in progress</string>
<string name="flutter_downloader_notification_canceled">Download canceled</string>
<string name="flutter_downloader_notification_failed">Download failed</string>
<string name="flutter_downloader_notification_complete">Download complete</string>
<string name="flutter_downloader_notification_paused">Download paused</string>
  • PackageInstaller: in order to open APK files, your application needs REQUEST_INSTALL_PACKAGES permission. Add following codes in your AndroidManifest.xml:
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

Usage

Import package:

import 'package:flutter_downloader/flutter_downloader.dart';

Initialize

WidgetsFlutterBinding.ensureInitialized();
await FlutterDownloader.initialize(
  debug: true // optional: set false to disable printing logs to console
);
  • Note: the plugin must be initialized before using.

Create new download task:

final taskId = await FlutterDownloader.enqueue(
  url: 'your download link',
  savedDir: 'the path of directory where you want to save downloaded files',
  showNotification: true, // show download progress in status bar (for Android)
  openFileFromNotification: true, // click on notification to open downloaded file (for Android)
);

Update download progress:

FlutterDownloader.registerCallback(callback); // callback is a top-level or static function

Important note: your UI is rendered in the main isolate, while download events come from a background isolate (in other words, codes in callback are run in the background isolate), so you have to handle the communication between two isolates. For example:

ReceivePort _port = ReceivePort();

@override
void initState() {
	super.initState();

	IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
	_port.listen((dynamic data) {
		String id = data[0];
		DownloadTaskStatus status = data[1];
		int progress = data[2];
		setState((){ });
	});

	FlutterDownloader.registerCallback(downloadCallback);
}

@override
void dispose() {
	IsolateNameServer.removePortNameMapping('downloader_send_port');
	super.dispose();
}

static void downloadCallback(String id, DownloadTaskStatus status, int progress) {
	final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port');
	send.send([id, status, progress]);
}

Load all tasks:

final tasks = await FlutterDownloader.loadTasks();

Load tasks with conditions:

final tasks = await FlutterDownloader.loadTasksWithRawQuery(query: query);
  • Note: In order to parse data into DownloadTask object successfully, you should load data with all fields from DB (in the other word, use: SELECT * ). For example:
SELECT * FROM task WHERE status=3
  • Note: the following is the schema of task table where this plugin stores tasks information
CREATE TABLE `task` (
	`id`	INTEGER PRIMARY KEY AUTOINCREMENT,
	`task_id`	VARCHAR ( 256 ),
	`url`	TEXT,
	`status`	INTEGER DEFAULT 0,
	`progress`	INTEGER DEFAULT 0,
	`file_name`	TEXT,
	`saved_dir`	TEXT,
	`resumable`	TINYINT DEFAULT 0,
	`headers`	TEXT,
	`show_notification`	TINYINT DEFAULT 0,
	`open_file_from_notification`	TINYINT DEFAULT 0,
	`time_created`	INTEGER DEFAULT 0
);

Cancel a task:

FlutterDownloader.cancel(taskId: taskId);

Cancel all tasks:

FlutterDownloader.cancelAll();

Pause a task:

FlutterDownloader.pause(taskId: taskId);

Resume a task:

FlutterDownloader.resume(taskId: taskId);
  • Note: resume() will return a new taskId corresponding to a new background task that is created to continue the download process. You should replace the original taskId (that is marked as paused status) by this new taskId to continue tracking the download progress.

Retry a failed task:

FlutterDownloader.retry(taskId: taskId);
  • Note: retry() will return a new taskId (like resume())

Remove a task:

FlutterDownloader.remove(taskId: taskId, shouldDeleteContent:false);

Open and preview a downloaded file:

FlutterDownloader.open(taskId: taskId);
  • Note: in Android, you can only open a downloaded file if it is placed in the external storage and there's at least one application that can read that file type on your device.

Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome.

Comments
  • --- Failed to create image decoder with message 'unimplemented'

    --- Failed to create image decoder with message 'unimplemented'

    when i perform FlutterDownloader.loadTasks(),it reported Failed to create image decoder with message 'unimplemented',

    this is my code :

    Future get _apkLocalPath async { final directory = await getExternalStorageDirectory(); return directory.path; }

    Future _executeDownload(String downLoadUrl) async { final path = await _apkLocalPath; final taskId = await FlutterDownloader.enqueue( url: downLoadUrl, fileName: 'update.apk', savedDir: path, showNotification: true, openFileFromNotification: true ); FlutterDownloader.registerCallback((id, status, progress) { if (taskId == id && status == DownloadTaskStatus.complete) { print('install'); _installApk(); } });

    await FlutterDownloader.loadTasks(); }

    [✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.13.6 17G7024, locale zh-Hans-CN)

    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 10.1) [✓] iOS tools - develop for iOS devices [✓] Android Studio (version 3.3) [✓] VS Code (version 1.37.1) [✓] Connected device (1 available)

    bug 
    opened by weiliang0626 36
  • Stuck at Installing build\app\outputs\apk\app.apk...

    Stuck at Installing build\app\outputs\apk\app.apk...

    I used to use 1.2.1, it worked fine and nice. Since a few days ago, I got 'keep stopping'. Then I tried to use the most up to date version and need add a new MyApplication.

    But with it, I cannot start the app, it stuck at Installing build\app\outputs\apk\app.apk..., any idea?

    opened by wyxcoder 29
  • Downloading stuck in progress

    Downloading stuck in progress

    Got this once so far so can't provide any more details. Notification was stuck at in progress and killing the app or going offline didn't remove it. In logs progress was 100% and no visible errors. I was downloading 2 files in parallel, the other one finished just fine.

    opened by AAverin 26
  •  FAILURE: Build failed with an exception.

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. > com.android.build.api.transform.TransformException: Error while generating the main dex list: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: androidx.work.ArrayCreatingInputMerger * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 3s ******************************************************************************************* The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app. See https://goo.gl/CP92wY for more information on the problem and how to fix it. ******************************************************************************************* Gradle task assembleDebug failed with exit code 1 Getting this build error after using flutter_downloader package...
    opened by Zeeshan0201 24
  • java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE

    java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE

    As comment in issue #533 , i update to v1.7.1。And the problem is occured: ` java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl) at com.sun.tools.javac.util.Assert.error(Assert.java:133) at com.sun.tools.javac.code.TypeAnnotations.annotationType(TypeAnnotations.java:231) at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.separateAnnotationsKinds(TypeAnnotations.java:294) at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitVarDef(TypeAnnotations.java:1164) at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:57) at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.visitClassDef(TypeAnnotations.java:1042) at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693) at com.sun.tools.javac.tree.TreeScanner.scan(TreeScanner.java:49) at com.sun.tools.javac.code.TypeAnnotations$TypeAnnotationPositions.scan(TypeAnnotations.java:275) at com.sun.tools.javac.code.TypeAnnotations$1.run(TypeAnnotations.java:127) at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:152) at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:129) at com.sun.tools.javac.comp.Enter.complete(Enter.java:512) at com.sun.tools.javac.comp.Enter.main(Enter.java:471) at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857) at com.sun.tools.javac.main.Main.compile(Main.java:523) at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129) at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138) at org.gradle.api.internal.tasks.compile.AnnotationProcessingCompileTask.call(AnnotationProcessingCompileTask.java:93) at org.gradle.api.internal.tasks.compile.ResourceCleaningCompilationTask.call(ResourceCleaningCompilationTask.java:57) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:54) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:39) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38) at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51) at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39) at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:101) at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:97) at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60) at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44) at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59) at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:158) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:126) at com.android.build.gradle.tasks.AndroidJavaCompile.compile(AndroidJavaCompile.kt:237) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103) at org.gradle.api.internal.project.taskfactory.IncrementalTaskInputsTaskAction.doExecute(IncrementalTaskInputsTaskAction.java:47) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:42) at org.gradle.api.internal.project.taskfactory.AbstractIncrementalTaskAction.execute(AbstractIncrementalTaskAction.java:25) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:476) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:461) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:444) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:93) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:237) at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$0(ExecuteStep.java:32) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:32) at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58) at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48) at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33) at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39) at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73) at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54) at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35) at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45) at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31) at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:208) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70) at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45) at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43) at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38) at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24) at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96) at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89) at java.util.Optional.map(Optional.java:215) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54) at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76) at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36) at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90) at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:69) at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:47) at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:140) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108) at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67) at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) at java.lang.Thread.run(Thread.java:748)

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':flutter_downloader:compileDebugJavaWithJavac'.

    Compilation failed; see the compiler error output for details.

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 11s Exception: Gradle task assembleDebug failed with exit code 1 `

    opened by chendengyuanxm 20
  • XCode archive error 'No such module flutter_downloader' when using AppDelegate.swift

    XCode archive error 'No such module flutter_downloader' when using AppDelegate.swift

    I can't archive the project with XCode if I use AppDelegate.swift as stated in the docs. Both flutter run --release and flutter build ios work.

    • XCode: Version 11.3.1 (11C504)

    • AppDelegate.swift:

    import UIKit
    import Flutter
    import flutter_downloader
    
    @UIApplicationMain
    @objc class AppDelegate: FlutterAppDelegate {
      override func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
      ) -> Bool {
        GeneratedPluginRegistrant.register(with: self)
        FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
      }
    }
    
    private func registerPlugins(registry: FlutterPluginRegistry) {
        if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
           FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin"))
        }
    }
    
    • flutter doctor -v:
    [✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15.1 19B88, locale pt-BR)
        • Flutter version 1.12.13+hotfix.7 at /Users/JHBitencourt/Documents/
        • Framework revision 9f5ff2306b (8 weeks ago), 2020-01-26 22:38:26 -0800
        • Engine revision a67792536c
        • Dart version 2.7.0
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
        • Android SDK at /Users/JHBitencourt/Library/Android/sdk
        • Android NDK location not configured (optional; useful for native profiling support)
        • Platform android-29, build-tools 29.0.2
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 11.3.1, Build version 11C504
        • CocoaPods version 1.8.4
    
    [✓] Android Studio (version 3.5)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 41.0.2
        • Dart plugin version 191.8593
        • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    
    • Error:

    image_error

    opened by JHBitencourt 20
  • All of the listen() method can't be called after called initialize()

    All of the listen() method can't be called after called initialize()

    version: flutter_downloader: ^1.3.3 platform: ios simulator

    code below: void main() async{ await FlutterDownloader.initialize(); runApp(MusicianApp()); }

    plugin audioplayers:^0.12.0:

    audioPlayer.onPlayerStateChanged.listen((state) { // never being called }

    plugin flutter_sound: ^1.4.8:

    flutterSound.onRecorderDbPeakChanged.listen((value) { // never being called })

    flutter doctor -v : [✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.6 18G1012, locale en-CN) • Flutter version 1.9.1+hotfix.4 at /Users/cyh/flutter • Framework revision cc949a8e8b (9 weeks ago), 2019-09-27 15:04:59 -0700 • Engine revision b863200c37 • Dart version 2.5.0

    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/cyh/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 28.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

    [✓] Xcode - develop for iOS and macOS (Xcode 11.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.2.1, Build version 11B500 • CocoaPods version 1.7.0.beta.3

    [✓] Android Studio (version 3.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 34.0.1 • Dart plugin version 182.5215 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

    [✓] IntelliJ IDEA Ultimate Edition (version 2018.3.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin version 32.0.3 • Dart plugin version 183.5429.25

    [✓] VS Code (version 1.36.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.1.0

    [✓] Connected device (1 available) • iPhone X • DFDBB98C-3C75-4688-8832-83AE4FD2001D • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)

    ! Doctor found issues in 1 category.

    opened by lxcyha 20
  • Flutter downloader is not working in Android 11.

    Flutter downloader is not working in Android 11.

    While I'm able to download and view the file successfully in Android 6 phone, it is not working in Android 11. In Android 11, both log as well as notification says file is downloaded successfully. But in Android 11, file is not actually saved in drive. Please find below code

    AndroidManifest.xml

    <application
        android:icon="@mipmap/ic_launcher"
        android:label="eCommerce"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:hardwareAccelerated="true">
        <activity
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:launchMode="singleTop"
            android:requestLegacyExternalStorage="true"
            android:theme="@style/LaunchTheme"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="io.flutter.embedding.android.NormalTheme"
                android:resource="@style/NormalTheme" />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
                android:name="io.flutter.embedding.android.SplashScreenDrawable"
                android:resource="@drawable/launch_background" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
        <service
            android:name=".MyPrintService"
            android:permission="android.permission.BIND_PRINT_SERVICE">
            <intent-filter>
                <action android:name="android.printservice.PrintService" />
            </intent-filter>
        </service>
    
        <provider
            android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
            android:authorities="${applicationId}.flutter_downloader.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
    
        <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>
    
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.flutter_inappwebview.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>
    </application>
    
    <!--    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>-->
    <!--    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>-->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />
    

    Dart code

    final fldr = (Platform.isAndroid ? await getExternalStorageDirectory() : await getApplicationSupportDirectory()); final taskId = await FlutterDownloader.enqueue( url: url.toString(), savedDir: fldr.path, showNotification: true, // show download progress in status bar (for Android) openFileFromNotification: true, );

    opened by swafvan 17
  • "Worker result FAILURE" on Android

    Plugin works like a breeze on iOS, but I get an error on Android.

    This is what I get from the log:

    I/flutter (27342): Download task is enqueued with id(a1fd47bc-d615-41ba-8eb9-65dc173bfafb)
    D/SystemJobScheduler(27342): Scheduling work ID a1fd47bc-d615-41ba-8eb9-65dc173bfafb Job ID 19
    D/GreedyScheduler(27342): Starting tracking for a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/SystemJobService(27342): onStartJob for a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/ConstraintTracker(27342): NetworkStateTracker: initial state = [ Connected=true Validated=true Metered=false NotRoaming=true ]
    D/NetworkStateTracker(27342): Registering network callback
    D/WorkConstraintsTracker(27342): Constraints met for a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/GreedyScheduler(27342): Constraints met: Scheduling work ID a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/WorkConstraintsTracker(27342): Constraints met for a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/GreedyScheduler(27342): Constraints met: Scheduling work ID a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/Processor(27342): Processor: processing a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/Processor(27342): Work a1fd47bc-d615-41ba-8eb9-65dc173bfafb is already enqueued for processing
    D/Processor(27342): Work a1fd47bc-d615-41ba-8eb9-65dc173bfafb is already enqueued for processing
    D/NetworkStateTracker(27342): Network capabilities changed: [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&FOREGROUND LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -50]
    D/WorkerWrapper(27342): Worker result FAILURE for a1fd47bc-d615-41ba-8eb9-65dc173bfafb
    D/Processor(27342): Processor a1fd47bc-d615-41ba-8eb9-65dc173bfafb executed; isSuccessful = false, reschedule = false
    D/SystemJobService(27342): a1fd47bc-d615-41ba-8eb9-65dc173bfafb executed on JobScheduler
    I/zygote64(27342): Do partial code cache collection, code=61KB, data=47KB
    I/zygote64(27342): After code cache collection, code=61KB, data=47KB
    I/zygote64(27342): Increasing code cache capacity to 256KB
    

    This is my code:

    String taskId = await FlutterDownloader.enqueue(url: link, savedDir: path,);
    

    I know nothing about Android Studio or how to debug Android Apps, so I really don't know how where to start to debug this issue.

    Thanks

    bug 
    opened by webpn 17
  • iOS: await FlutterDownloader.initialize(); leads to google sign in cancel button crash

    iOS: await FlutterDownloader.initialize(); leads to google sign in cancel button crash

    iOS Only: After initializing await FlutterDownloader.initialize(); in main() when google sign in popup appears and user press cancel.. APP Crashes.

    Please look into.

    This is very basic to use google sign in. Many users will face the same.

    opened by MunishThakur 16
  • Failed to set registerPlugins on iOS

    Failed to set registerPlugins on iOS

    Hi! I'm having a problem running an app with this plugin installed. I've done everything I found on the internet and nothing works... If I comment await FlutterDownloader.initialize(); I can start the application.

    Exception:

    [   +2 ms] [DEVICE LOG] 2020-01-09 10:10:13.600816+0100  localhost Runner[14546]: methodCallHandler: initialize
    [        ] [DEVICE LOG] 2020-01-09 10:10:13.601151+0100  localhost Runner[14546]: startBackgroundIsolate
    [        ] [DEVICE LOG] 2020-01-09 10:10:13.639051+0100  localhost Runner[14546]: (Foundation) *** Assertion failure in -[FlutterDownloaderPlugin startBackgroundIsolate:], /Users/breakpoint/Flutter/.pub-cache/hosted/pub.dartlang.org/flutter_downloader-1.3.4/ios/Classes/FlutterDownloaderPlugin.m:117
    [        ] [DEVICE LOG] 2020-01-09 10:10:13.686382+0100  localhost Runner[14546]: (CoreFoundation) *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'failed to set registerPlugins'
    [        ] [DEVICE LOG] *** First throw call stack:
    [   +4 ms] [DEVICE LOG] (
    [        ] [DEVICE LOG]         0   CoreFoundation                      0x000000010a5828db __exceptionPreprocess + 331
    [        ] [DEVICE LOG]         1   libobjc.A.dylib                     0x0000000109437ac5 objc_exception_throw + 48
    [        ] [DEVICE LOG]         2   CoreFoundation                      0x000000010a582662 +[NSException raise:format:arguments:] + 98
    [        ] [DEVICE LOG]         3   Foundation                          0x0000000108b0d76b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
    [        ] [DEVICE LOG]         4   Runner                              0x0000000105e50cfe -[FlutterDownloaderPlugin startBackgroundIsolate:] + 782
    [        ] [DEVICE LOG]         5   Runner                              0x0000000105e569eb -[FlutterDownloaderPlugin initializeMethodCall:result:] + 187
    [        ] [DEVICE LOG]         6   Runner                              0x0000000105e5a7d0 -[FlutterDownloaderPlugin handleMethodCall:result:] + 256
    [        ] [DEVICE LOG]         7   Flutter                             0x0000000106a98f95 __45-[FlutterMethodCha<…>
    [  +16 ms] methodCallHandler: initialize
    [        ] startBackgroundIsolate
    [        ] *** First throw call stack:
    [        ] (
    [        ]      0   CoreFoundation                      0x000000010a5828db __exceptionPreprocess + 331
    [        ]      1   libobjc.A.dylib                     0x0000000109437ac5 objc_exception_throw + 48
    [        ]      2   CoreFoundation                      0x000000010a582662 +[NSException raise:format:arguments:] + 98
    [        ]      3   Foundation                          0x0000000108b0d76b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
    [        ]      4   Runner                              0x0000000105e50cfe -[FlutterDownloaderPlugin startBackgroundIsolate:] + 782
    [        ]      5   Runner                              0x0000000105e569eb -[FlutterDownloaderPlugin initializeMethodCall:result:] + 187
    [        ]      6   Runner                              0x0000000105e5a7d0 -[FlutterDownloaderPlugin handleMethodCall:result:] + 256
    [        ]      7   Flutter                             0x0000000106a98f95 __45-[FlutterMethodCha<…>
    [   +3 ms] Service protocol connection closed.
    [        ] Lost connection to device.
    
    

    main.dart:

    void main() async {
      WidgetsFlutterBinding.ensureInitialized();
      await FlutterDownloader.initialize();
    
      ...
    }
    

    AppDelegate.m:

    #include "AppDelegate.h"
    #include "GeneratedPluginRegistrant.h"
    #include "FlutterDownloaderPlugin.h"
    
    @implementation AppDelegate
    
    void registerPlugins(NSObject<FlutterPluginRegistry>* registry) {
        [FlutterDownloaderPlugin registerWithRegistrar:[registry registrarForPlugin:@"vn.hunghd.flutter_downloader"]];
    }
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        if (@available(iOS 10.0, *)) {
            [UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>)self;
        }
    
        [GeneratedPluginRegistrant registerWithRegistry:self];
        [FlutterDownloaderPlugin setPluginRegistrantCallback:registerPlugins];
    
        return [super application:application didFinishLaunchingWithOptions:launchOptions];
    }
    
    @end
    

    flutter doctor:

    [✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.13.6 17G10021,
        locale en-BA)
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 10.3)
    [✓] Android Studio (version 3.3)
    [✓] IntelliJ IDEA Community Edition (version 2019.3.1)
    [✓] Connected device (1 available)
    
    • No issues found!
    

    flutter_downloader version:

    1.3.4
    
    opened by anisalibegic 15
  • Task is always equeued

    Task is always equeued

    I added `@pragma('vm:entry-point').

      @pragma('vm:entry-point')
      static void _downloadCallback(
          String id, DownloadTaskStatus status, int progress) {
        final SendPort? send =
            IsolateNameServer.lookupPortByName('downloader_send_port');
        send?.send([id, status, progress]);
      }
    

    this my log on a user's release app. i can't recurrent in my device. the task status is always DownloadTaskStatus(1)

    downloading...  DownloadTask(taskId: 6a217443-9767-44e2-b83e-81d2cb07c016, status: DownloadTaskStatus(1), progress: 0, url: https://images.linjieapp.com/images/ba7d8c51a42914c0bb10431ca9e914bc.png?x-oss-process=image/resize,w_1080,h_1439,m_lfit/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_966, filename: null, savedDir: /data/user/0/tech.echoing.congress/cache/image, timeCreated: 1672907271706, allowCellular: true)
    
    downloading...DownloadTask(taskId: 9ffa9aca-52fc-4ba2-bf16-804121514dd0, status: DownloadTaskStatus(1), progress: 0, url: https://images.linjieapp.com/images/ff40c00545415aacae200ef5fb83cd26.png?x-oss-process=image/resize,w_1080,h_1080,m_lfit/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_966, filename: null, savedDir: /data/user/0/tech.echoing.congress/cache/image, timeCreated: 1672907237533, allowCellular: true)
    
    downloading...DownloadTask(taskId: 6a217443-9767-44e2-b83e-81d2cb07c016, status: DownloadTaskStatus(1), progress: 0, url: https://images.linjieapp.com/images/ba7d8c51a42914c0bb10431ca9e914bc.png?x-oss-process=image/resize,w_1080,h_1439,m_lfit/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_0,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_483,y_966/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_0/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_483/watermark,image_aW1hZ2VzLzc5YTMyZTkwLTc2ZTEtMTFlZC1iZjU3LTQzZTZiZjFiOTQwMy5wbmc=,g_sw,x_966,y_966, filename: null, savedDir: /data/user/0/tech.echoing.congress/cache/image, timeCreated: 1672907271706, allowCellular: true)
    
    
    
    • Device: oppoR7x ColorOS 12.1 Android 12
    • OS: Android 12
    • plugin version 1.10.0 img_v2_2f1a8bfd-0648-416f-ba1b-fe73ebfca9ag
    bug 
    opened by lwj1994 0
  • Flutter downloader not loading  tasks in ios

    Flutter downloader not loading tasks in ios

    After downloading the file the plugin does not load the the tasks .

    FlutterDownloader.loadTasks() not loading downloaded tasks or its progress

    List? getTasks = await FlutterDownloader.loadTasks();

    it shows empty it works in android but not working in ios simulator

    bug 
    opened by noeljayson 0
  • Cannot query downloaded task in IOS after upgrade to flutter_downloader: ^1.10.0

    Cannot query downloaded task in IOS after upgrade to flutter_downloader: ^1.10.0

    It was working fine until I upgrade the plugin from 1.9.1 to 1.10.0

    final completedTask = await FlutterDownloader.loadTasksWithRawQuery( query: 'SELECT * FROM task WHERE status = 3');

    bug 
    opened by basnetjiten 0
  • How to encrypt downloading file.

    How to encrypt downloading file.

    Describe the bug

    To Reproduce

    Steps to reproduce the behavior:

    1. Go to '...'
    2. Click on '....'
    3. Scroll down to '....'
    4. See error

    Expected behavior

    Screenshots

    Desktop (please complete the following information):

    • OS: [e.g. iOS]
    • Browser [e.g. chrome, safari]
    • Version [e.g. 22]

    Device information:

    • Device: [e.g. iPhone 13]
    • OS: [e.g. iOS 15.4]
    • plugin version [e.g. v1.8.0]

    Additional context

    bug 
    opened by dghub-founder 0
  • Cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22

    Cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22

    FAILURE: Build failed with an exception.

    • What went wrong: A problem occurred configuring project ':flutter_downloader'.

    Could not resolve all artifacts for configuration ':flutter_downloader:classpath'. Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22. Required by: project :flutter_downloader > Cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22: - gradle70JavadocElements - gradle70RuntimeElements - gradle70SourcesElements - gradle71JavadocElements - gradle71RuntimeElements - gradle71SourcesElements - javadocElements - runtimeElementsWithFixedAttribute - sourcesElements All of them match the consumer attributes: - Variant 'gradle70JavadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22: - Unmatched attributes: - Found org.gradle.category 'documentation' but wasn't required. - Found org.gradle.docstype 'javadoc' but wasn't required. - Required org.gradle.jvm.version '11' but no value provided. - Required org.gradle.libraryelements 'jar' but no value provided. - Found org.gradle.plugin.api-version '7.0' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attributes: - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'. - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'. - Variant 'gradle70RuntimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22: - Unmatched attributes: - Found org.gradle.category 'library' but wasn't required. - Found org.gradle.jvm.environment 'standard-jvm' but wasn't required. - Found org.gradle.plugin.api-version '7.0' but wasn't required. - Found org.gradle.status 'release' but wasn't required. - Compatible attributes: - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'. - Required org.gradle.jvm.version '11' and found compatible value '8'. - Required org.gradle.libraryelements 'jar' and found compatible value 'jar'. - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'. - Variant 'gradle70SourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.22:

    bug 
    opened by asd39715 0
Owner
Flutter Community
A central place for all community made Flutter packages. To get started, see the README of the 'community' repository.
Flutter Community
Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

On most operating systems, permissions aren't just granted to apps at install time. Rather, developers have to ask the user for permissions while the

Baseflow 1.7k Jan 3, 2023
File picker plugin for Flutter, compatible with both iOS & Android and desktop (go-flutter).

File Picker A package that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support. Currently s

Miguel Ruivo 985 Jan 5, 2023
A Flutter plugin to easily handle realtime location in iOS and Android. Provides settings for optimizing performance or battery.

Flutter Location Plugin This plugin for Flutter handles getting location on Android and iOS. It also provides callbacks when location is changed. Gett

Guillaume Bernos 953 Dec 22, 2022
Flutter geolocation plugin for Android and iOS.

geolocation Flutter geolocation plugin for Android API 16+ and iOS 9+. Features: Manual and automatic location permission management Current one-shot

Loup 221 Dec 27, 2022
A Flutter plugin for displaying local notifications on Android, iOS and macOS

Flutter Local Notifications plugin This repository consists hosts the following packages flutter_local_notifications: code for the cross-platform faci

Michael Bui 2.1k Dec 30, 2022
Android and iOS Geolocation plugin for Flutter

Flutter Geolocator Plugin A Flutter geolocation plugin which provides easy access to platform specific location services (FusedLocationProviderClient

Baseflow 1k Jan 5, 2023
Telegram stickers importing Flutter plugin for iOS and Android

TelegramStickersImport — Telegram stickers importing Flutter plugin for iOS and Android TelegramStickersImport helps your users import third-party pro

Iurii Dorofeev 20 Dec 3, 2022
Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android.

flutter_udid Plugin to retrieve a persistent UDID across app reinstalls on iOS and Android. Getting Started import 'package:flutter_udid/flutter_udid.

Leon Kukuk 183 Dec 21, 2022
Support to update the app badge on the launcher (both for Android and iOS)

Flutter App Badger plugin This plugin for Flutter adds the ability to change the badge of the app in the launcher. It supports iOS and some Android de

Edouard Marquez 258 Dec 25, 2022
Flutter library for iOS Widgets Extensions. Integrate a Widget into your App 🍏📱

flutter_widgetkit Flutter Library for the iOS ?? WidgetKit framework and Widget Communication Table of Contents ?? Introduction ??‍?? Installation ??‍

Fasky 227 Dec 31, 2022
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.

Flutter InAppWebView Plugin A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser windo

Lorenzo Pichilli 2.3k Jan 8, 2023
A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed apps.

Flutter AppAvailability Plugin A Flutter plugin that allows you to check if an app is installed/enabled, launch an app and get the list of installed a

Lorenzo Pichilli 89 Dec 2, 2022
A lightweight Flutter plugin for making payments and printing on MyPos

my_poster ?? my_poster is in beta - please provide feedback (and/or contribute) if you find issues ??️ A lightweight Flutter plugin for making payment

Antonio Mentone 3 Oct 10, 2022
Plugin to access VPN service for Flutter | Flutter 的 VPN 插件

Flutter VPN plugin This plugin help developers to access VPN service in their flutter app. 本插件帮助开发者在自己的应用内调用 VPN 服务。 The Android part was implemented

Xdea 277 Dec 28, 2022
Community WebView Plugin - Allows Flutter to communicate with a native WebView.

NOTICE We are working closely with the Flutter Team to integrate all the Community Plugin features in the Official WebView Plugin. We will try our bes

Flutter Community 1.4k Jan 7, 2023
Use dynamic and beautiful card view pagers to help you create great apps.

Use dynamic and beautiful card view pagers to help you create great apps. Preview New Feature v1.3.0 Change Alignment Left Center(Default) Right v1.4.

Jeongtae Kim 84 Dec 6, 2022
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android.

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support

Flutter Download Manager is a Cross-Platform file downloader with Parallel and Batch Download support. Manage download tasks by url and be notified of status and their progress. Pause, Cancel, Queue and Resume Downloads.

Nabil Mosharraf 11 Dec 17, 2022
Caffodils - Download everything | Flutter app for Android and IOS. Download Video, Reels, Shorts, Music, Images, Files from Instagram, Facebook and Youtube

caffodils Caffodils - Download everything Flutter app for Android and IOS. Download Video, Reels, Shorts, Music, Images, Files from Instagram, Faceboo

Caffodils 11 Oct 24, 2022
dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on background

dosdownloader Dos downloader app is developed for downloading video. You can download video from YouTube and Facebook. You can also play video on back

Md Abir Ahsan Tahmim 1 Dec 8, 2021