Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with image codec and loading images into this example #4

Open
devzom opened this issue Mar 19, 2020 · 2 comments
Open

Issue with image codec and loading images into this example #4

devzom opened this issue Mar 19, 2020 · 2 comments

Comments

@devzom
Copy link
Contributor

devzom commented Mar 19, 2020

I/flutter (10134): EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE 
I/flutter (10134): The following assertion was thrown resolving an image codec:
I/flutter (10134): Unable to load asset:
I/flutter (10134): 
I/flutter (10134): When the exception was thrown, this was the stack:
I/flutter (10134): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
I/flutter (10134): <asynchronous suspension>
I/flutter (10134): #1      AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:649:31)
I/flutter (10134): #2      AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:630:14)
I/flutter (10134): #3      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:491:13)
I/flutter (10134): #4      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:359:22)
I/flutter (10134): #5      ImageProvider.resolveStreamForKey (package:flutter/src/painting/image_provider.dart:489:80)
I/flutter (10134): #6      ScrollAwareImageProvider.resolveStreamForKey (package:flutter/src/widgets/scroll_aware_image_provider.dart:106:19)
I/flutter (10134): #7      ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:330:9)
I/flutter (10134): #8      ImageProvider._createErrorHandlerAndKey.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:450:26)
I/flutter (10134): (elided 13 frames from dart:async)
I/flutter (10134): 
I/flutter (10134): Image provider: AssetImage(bundle: null, name: "")
I/flutter (10134): Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#13d10(), name: "", scale: 1.0)

The following assertion was thrown resolving an image codec:
Unable to load asset: 

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:649:31)
#2      AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:630:14)
#3      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:491:13)
...
Image provider: AssetImage(bundle: null, name: "")
Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#13d10(), name: "", scale: 1.0)

have any idea how to fix it ?

tried to fix it by adding assets to pubspec

  assets:
    - assets/destination_map_marker.png
    - assets/driving_pin.png
    - assets/friend1.jpg
    - assets/friend2.jpg
  but didn't work

also changed a way to sync images like this:

 BitmapDescriptor.fromAssetImage(ImageConfiguration(devicePixelRatio: 2.0),
            'assets/destination_map_marker.png')
        .then((onValue) {
      destinationIcon = onValue;
    });
  }

but its not this

@devzom devzom changed the title Issue with image coded BitmapDescriptor Issue with image codec and loading images into this example Mar 19, 2020
@jgervin
Copy link

jgervin commented May 19, 2020

The issue isn't with fromAssetImage. The issue is the PinInformation currentlySelectedPin.

@devzom
Copy link
Contributor Author

devzom commented Jun 4, 2022

Okey, let's close it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants