'Flutter can't find file downloaded to the flutter_assets folder
I download a file from AWS after runtime, and I checked to confirm that the file gets saved correctly in:
/data/user/0/APPNAME/app_flutter/flutter_assets/FILENAME.zip
where APPNAME is the name of my app and FILENAME is the name of the file I store.
Then I have a function from a package that needs to access this file, but it has to be in the flutter_assets folder. However, I get a java.io.FileNotFoundException: flutter_assets/FILENAME.zip
. I tried adding flutter_assets to the pubspec.yaml
file like this:
flutter:
assets:
- flutter_assets/
and also added this:
aaptOptions {
noCompress 'zip'
}
to android/app/build.gradle
within the android{...}
block but it didn't help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|