question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File download no response.

See original GitHub issue

I followed the instructions on https://pub.dev/packages/flutter_downloader#-readme-tab- and https://github.com/fluttercommunity/flutter_downloader/blob/master/example/lib/main.dart, installed flutter_downloader: ^1.4.1, modified android\app\src\main\AndroidManifest.xml as the following.

android\app\src\main\AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jeecgboot_app">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="jeecgboot_app"
        android:usesCleartextTraffic="true"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <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>
        <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">
            <!-- 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>
        <!-- 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" />
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
</manifest>

modified main.dart like the following.

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

  runApp(new MyApp());
}

And In a onPress callback I wrote code like the following.

            onPressed: () async {
              // Downloader.download(fileUrl, fileName, '.$fileType');
              var _saveDir = await _findLocalPath(context);
              final taskId = await FlutterDownloader.enqueue(
                url: fileUrl,
                savedDir: _saveDir,
                showNotification:
                    true, // show download progress in status bar (for Android)
                openFileFromNotification:
                    true, // click on notification to open downloaded file (for Android)
              );
              print('_saveDir: $_saveDir, taskId: $taskId');
              final tasks = await FlutterDownloader.loadTasks();
              print('tasks: $tasks');
              Navigator.of(context).pop();
            },

However no error info printed, from the debug console log, I can only see the DownloadTask is always enqueue status, I have tried almost everything I can, but it seems the same result, no notification, no other log info.

I/flutter ( 6509): Download task is enqueued with id(d8463edf-ca00-42f4-8b89-417bc8157f93)
I/flutter ( 6509): _saveDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download, taskId: d8463edf-ca00-42f4-8b89-417bc8157f93
I/flutter ( 6509): tasks: [DownloadTask(taskId: 3ca10fa1-41b4-4296-b521-93fc6626f789, status: DownloadTaskStatus(1), progress: 0, url: http://192.168.1.96:3000/jeecg-boot/sys/common/static/mementopython3-english_1583207294984.pdf, filename: null, savedDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download), DownloadTask(taskId: d8463edf-ca00-42f4-8b89-417bc8157f93, status: DownloadTaskStatus(1), progress: 0, url: http://192.168.1.96:3000/jeecg-boot/sys/common/static/IPAccessHandler-fix_1583205752923.txt, filename: null, savedDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download)]

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
AbanoubNassemcommented, Mar 13, 2020

any luck ? facing the same issue!

2reactions
liudonghua123commented, Mar 3, 2020

I also tried the latest example app, but after I clicked the download icon, no response later.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple Methods To Fix Downloads Folder Not Responding On ...
Simple Methods To Fix Downloads Folder Not Responding On Windows ; Solution 1: SFC Scan · : Press Wins + R keys to...
Read more >
Fix file download errors - Google Chrome Help
This error means that there's not enough space on your computer to download the file. To fix the error: Delete some files from...
Read more >
vue.js - C# File Download no response in the frontend and ...
Use document.location.href = response.request.responseURL this.$axios .get(process.env.API.EQUIPMENT_OTHER_DOWNLOADZIP + '?
Read more >
Download attachment file of POST API response from a ...
I'm using the POST HTTP request to download all files, but unfortunately I get my .zip file as a string. Could you please...
Read more >
Downloads Folder Not Responding on Windows 10? Fix It Now!
Feel free to follow offered solutions here to fix and repair the 'Can't open Downloads folder' error and restore all files from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found