[英]unable to use path_provider in flutter
I am using path provider packager in my flutter app.我在我的颤振应用程序中使用路径提供程序打包程序。 1. I added dependencies in my pubspec.yaml file 2. run flutter package get [No error here] 3. import packages 1. 我在 pubspec.yaml 文件中添加了依赖项 2. 运行 flutter package get [No error here] 3. import packages
When I am trying to the app.当我尝试使用该应用程序时。 it through the below error.它通过以下错误。
PS C:\android-app\flutter-app-test\file_io> flutter run
Launching lib/main.dart on XT1706 in debug mode...
Initializing gradle... 4.5s
Resolving dependencies... 13.6s
Running 'gradlew assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':path_provider:platformAttrExtractor'.
> A failure occurred while executing com.android.build.gradle.internal.actionio
> A failure occurred while executing com.android.build.gradle.internal.actaons.AttrExtractor
> A failure occurred while executing com.android.build.gradle.internal.lctions.AttrExtractor deb.actions.AttrExtractor
error in opening zip file --
> A failure occurred while executing com.android.build.gradle.internal.actions.AttrExtractor
> error in opening zip file
thanks in advance.提前致谢。
I hope this is helpful to you我希望这对你有帮助
In your pubspec.yaml file Add path_provider as a dependencies在您的 pubspec.yaml 文件中添加 path_provider 作为依赖项
sependencies:
flutter:
sdk: flutter
path_provider:
and save it while importing the file use并在导入文件时保存它使用
import 'package:path_provider/path_provider.dart';
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.