gpt4 book ai didi

flutter - 错误 : downloads_path_provider in flutter

转载 作者:行者123 更新时间:2023-12-04 15:29:20 26 4
gpt4 key购买 nike

我正在使用 This package在android中获取下载路径,效果很好。通过使用这个包,我得到了我想要的 /storage/emulated/0/Download

问题:当我运行 flutter run --release 时会抛出一个错误。

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'...

如果无法解决,则建议如何获取此路径 /storage/emulated/0/Download 或其他方法。

更新:我刚看到Repo of Downloads_path_provider上面写着

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

我应该使用什么来获取此路径 /storage/emulated/0/Download。谢谢。

最佳答案

改为使用 ext_storage插件:

ExtStorage.getExternalStoragePublicDirectory(ExtStorage.DIRECTORY_DOWNLOADS);

我遇到了同样的问题并为我工作。

关于flutter - 错误 : downloads_path_provider in flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61575703/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com