0
votes

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

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.

1
What Flutter version? Did you try flutter clean? - Günter Zöchbauer
@GünterZöchbauer Dart version 2.0.0-dev.63.0.flutter-4c9689c1d2 - prashant.fepale
with flutter clean still have same problem. - prashant.fepale
Sorry, no idea. Perhaps someone else. - Günter Zöchbauer
@GünterZöchbauer :) no problem. We will find out the solution. - prashant.fepale

1 Answers

0
votes

I hope this is helpful to you

In your pubspec.yaml file Add path_provider as a dependencies

sependencies:
  flutter:
    sdk: flutter
  path_provider:

and save it while importing the file use

import 'package:path_provider/path_provider.dart';