Skip to content

Image resource service unable to load asset #40972

@Smyrechynskyi

Description

@Smyrechynskyi

I use flutter_cache_manager for downloading images from Firebase Storage.
After upgrading Flutter to version 1.9.1+hotfix.2 application can't render images.
The exception is:

The following assertion was thrown resolving an image codec:
Unable to load asset: /data/user/0/com.altexsoft.perfectly/cache/libCachedImageData/f1b6d910-dbb0-11e9-9ad4-7153e7a6fec0.jpeg

When the exception was thrown, this was the stack: 
#0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
<asynchronous suspension>
#1      AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:464:44)
<asynchronous suspension>
#2      AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:449:14)
...
Image provider: AssetImage(bundle: null, name: "/data/user/0/com.altexsoft.perfectly/cache/libCachedImageData/f1b6d910-dbb0-11e9-9ad4-7153e7a6fec0.jpeg")
Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#6e68f(), name: "/data/user/0/com.altexsoft.perfectly/cache/libCachedImageData/f1b6d910-dbb0-11e9-9ad4-7153e7a6fec0.jpeg", scale: 1.0)

I have checked downloaded files from the Firebase and they are not empty.
Nor Image.asset widget (in my case), nor another widget cant render them.
After downgrading Flutter to version v1.7.8+hotfix.4 everything works perfectly.

pubspec.yaml:

`environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_storage: ^3.0.6
  bloc: ^0.15.0
  flutter_bloc: ^0.21.0
  intl: ^0.15.8
  flutter_cache_manager: ^1.1.1
  storage_file_repository:
    path: storage_file_repository
  task_repository:
    path: task_repository
  user_repository:
    path: user_repository
  equatable: ^0.3.0
  font_awesome_flutter: ^8.5.0
  file_picker: ^1.3.8
  keyboard_visibility: ^0.5.6
  vibration: ^1.2.1
  percent_indicator: ^2.1.1+1
  dynamic_theme: ^1.0.0
  enum_to_string: ^1.0.7
  connectivity: ^0.4.4

  cupertino_icons: ^0.1.2
  shared_preferences: ^0.5.2

dev_dependencies:
  flutter_test:
    sdk: flutter

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: imagesLoading, displaying, rendering imagesc: regressionIt was better in the past than it is now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions