简体   繁体   中英

Error: downloads_path_provider in flutter

I m using This package to get download path in android which work well. By using this Package I get /storage/emulated/0/Download which I want.

Problem: When I ran flutter run --release it throws an error.

Launching lib\main.dart on SM J700F in release mode...
Running Gradle task 'assembleRelease'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':downloads_path_provider:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\Sandeep Sharma\.gradle\caches\transforms-2\files-2.1\56f020e9c27d6a807cc1a74760f6e28d\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVa
riationSettings not found.

     C:\Users\Sandeep Sharma\.gradle\caches\transforms-2\files-2.1\56f020e9c27d6a807cc1a74760f6e28d\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcInd
ex not found.


* 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 2m 34s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                     158.0s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
Running Gradle task 'assembleAarRelease'...

if This can't be solved then suggest being how to get this path /storage/emulated/0/Download or another way around.

Update: I just saw Repo of Downloads_path_provider which says

This plugin has lots of inconsistencies and should no longer be used. Feel free to fork and tweak it.

what should I use to get this path /storage/emulated/0/Download . Thanks.

instead use the ext_storage plugin:

ExtStorage.getExternalStoragePublicDirectory(ExtStorage.DIRECTORY_DOWNLOADS);

I had the same issue and worked for me.

You have to use the official package provided by the flutter known as path_provide and use the getDownloadsDirectory() method to get the path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM