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

When targeting Android for a KMP project using Coil 3.0.0-alpha06, attempting to use .toBitmap() and .asComposeImageBitmap() results in Unresolved reference #4797

Closed
realityexpander opened this issue May 10, 2024 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists ide IDE related issue

Comments

@realityexpander
Copy link

realityexpander commented May 10, 2024

Describe the bug
This problem only exists on Android for KMP, for the Coil 3.0.0-alpha06 library.

Attempting to use the results of a pre-loaded imageLoader.execute(imageResquest).image in an Image Composable by converting it using .toBitmap() and .asComposeImageBitmap() results in a compile-time errors:

Unresolved reference: toBitmap
Unresolved reference: asComposeImageBitmap

Note:

  • When targeting iOS, Desktop or Javascript works as expected with no problems.
  • Using the normal coil3 AsyncImage works as expected in Android when using just imageRequest.

I'm not sure if this is a configuration issue, I checked all the examples and the Coil 3 upgrade guide, and could see no differences.

Referencing this conversation: coil-kt/coil#2246

To Reproduce
Here's the line that won't compile when targeting Android:
https://github.com/realityexpander/CloudCoverUSA2/blob/56d7575ac95903974b099738a015994aa5fdb972/composeApp/src/commonMain/kotlin/App.kt#L302

Code:
https://github.com/realityexpander/CloudCoverUSA2/releases/tag/coil3.alpha06.bug.report

Logs/Screenshots
image

Version
What library version are you using? Does this occur on a specific API level or Android device?
coil 3.0.0.alpha-06

@colinrtwhite
Copy link

colinrtwhite commented May 10, 2024

As previously mentioned, this issue isn't directly related to Coil. You can reproduce the issue by not importing Coil at all and adding a reference to org.jetbrains.skia.Bitmap in common code.

@MatkovIvan
Copy link
Member

Both mentioned functions are not available in common/Android, they are defined in the appropriate source set.
Issue for tracking the problem that IDE shows such suggestions: #3503

@MatkovIvan MatkovIvan added duplicate This issue or pull request already exists ide IDE related issue and removed submitted labels May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists ide IDE related issue
Projects
None yet
Development

No branches or pull requests

3 participants