skydoves / landscapist

🌻 A pluggable, highly optimized Jetpack Compose and Kotlin Multiplatform image loading library that fetches and displays network images with Glide, Coil, and Fresco.
https://skydoves.github.io/landscapist/
Apache License 2.0
2.13k stars 114 forks source link

FrescoImage crashing with Compose beta 07 #23

Closed mrmans0n closed 3 years ago

mrmans0n commented 3 years ago

Please complete the following information:

Describe the Bug:

After updating the compose dependency to 1.0.0-beta07, FrescoImage usages crash at runtime with this stacktrace:

05-19 10:09:28.796 29352 29352 E AndroidRuntime: FATAL EXCEPTION: main
05-19 10:09:28.796 29352 29352 E AndroidRuntime: Process: com.twitter.sandbox.uiarch, PID: 29352
05-19 10:09:28.796 29352 29352 E AndroidRuntime: java.lang.NoSuchMethodError: No interface method startRestartGroup(ILjava/lang/String;)Landroidx/compose/runtime/Composer; in class Landroidx/compose/runtime/Composer; or its super classes (declaration of 'androidx.compose.runtime.Composer' appears in /data/app/~~xzvvhkZTNhoZWKRPq8VHJg==/com.twitter.sandbox.uiarch-W3sSHxog8MH9aWO23m7A6A==/base.apk)
05-19 10:09:28.796 29352 29352 E AndroidRuntime:    at com.skydoves.landscapist.fresco.FrescoImage__FrescoImageKt.FrescoImage(FrescoImage.kt:85)
05-19 10:09:28.796 29352 29352 E AndroidRuntime:    at com.skydoves.landscapist.fresco.FrescoImage.FrescoImage(FrescoImage.kt:1)
05-19 10:09:28.796 29352 29352 E AndroidRuntime:    at com.twitter.sandbox.uiarch.samples.dogs.DogContentViewProviderKt.ShowDog(DogContentViewProvider.kt:136)

And this is the calling code:

    Row(modifier = Modifier.clickable { viewModel.loadNewDog() }) {
        FrescoImage(imageUrl = dogImage.url, modifier = Modifier.fillMaxSize(), contentScale = ContentScale.Fit)
    }

Expected Behavior:

Using FrescoImage should not cause a runtime crash.

skydoves commented 3 years ago

Hi @mrmans0n, Would you test using a SNAPSHOT version 1.2.2-SNAPSHOT? For importing the SNAPSHOT in your project, please add the below code.

repositories {
   maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
masterofdaemon commented 3 years ago

Hi @mrmans0n, Would you test using a SNAPSHOT version 1.2.2-SNAPSHOT? For importing the SNAPSHOT in your project, please add the below code.

repositories {
   maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

how can i use it in gradle.kts?

skydoves commented 3 years ago
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
masterofdaemon commented 3 years ago
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")

same Error : java.lang.NoSuchMethodError: No interface method startRestartGroup(ILjava/lang/String;)Landroidx/compose/runtime/Composer;

skydoves commented 3 years ago

I guess there is an official issue in compose-beta07. 🤔

Note: Libraries dependent on Compose will need to recompile with version 1.0.0‑beta07. Otherwise, libraries may encounter a NoSuchMethodError, such as: java.lang.NoSuchMethodError: No interface method startReplaceableGroup(ILjava/lang/String;)V in class Landroidx/compose/runtime/Composer; or its super classes. (Ia34e6)

masterofdaemon commented 3 years ago

I guess so, your module is the only one custom that i've used, can you report this issue?

wangchenyan commented 3 years ago

I use Google Accompanist instead

skydoves commented 3 years ago

@mrmans0n @masterofdaemon @wangchenyan

Released a new version 1.2.2. And please check your compose-related dependencies version on your project, and update.

composeVersion   : '1.0.0-beta07',
constraintVersion: '1.0.0-alpha07',
activityVersion  : '1.3.0-alpha08',
landscapistVersion : '1.2.2'

Thanks you for your issue :)