leavesCZY / Matisse

A Image/Video Selector Implemented with Jetpack Compose(一个用 Jetpack Compose 实现的 Android 图片视频选择框架)
https://github.com/leavesCZY/Matisse/wiki
Apache License 2.0
768 stars 60 forks source link

java.lang.AbstractMethodError: abstract method "void github.leavesczy.matisse.ImageEngine.Image" #19

Closed kgduyygyfhvk closed 1 year ago

kgduyygyfhvk commented 1 year ago

说我没有实现,可是我已经按照方法写了

kgduyygyfhvk commented 1 year ago

import android.net.Uri import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi import com.bumptech.glide.integration.compose.GlideImage import github.leavesczy.matisse.ImageEngine import kotlinx.parcelize.Parcelize

@Parcelize class GlideImageEngine : ImageEngine { @OptIn(ExperimentalGlideComposeApi::class) @Composable override fun Image( modifier: Modifier, model: Uri, contentScale: ContentScale, contentDescription: String? ) { GlideImage( modifier = modifier, model = model, contentScale = contentScale, contentDescription = contentDescription ) } }

leavesCZY commented 1 year ago

@kgduyygyfhvk 你这代码看起来大小写都不太对:@parcelize @composable,确定项目中写对了吗。另外也检查下是否真的引入了 Parcelize 插件

kgduyygyfhvk commented 1 year ago

image

kgduyygyfhvk commented 1 year ago

image 这里报错了,不知道啥情况

leavesCZY commented 1 year ago

会不会是因为你没有设置 kotlinCompilerExtensionVersion 的原因,compose 是需要这个才可以的,具体的版本号取决你项目的 kotlin 版本

    composeOptions {
        kotlinCompilerExtensionVersion "1.4.4"
    }
kgduyygyfhvk commented 1 year ago

@leavesCZY 但是我并没有用compose

kgduyygyfhvk commented 1 year ago

image

leavesCZY commented 1 year ago

一样的,只要你引入了 Matisse,就相当于在用 compose 呀,一样要引入 kotlinCompiler

kgduyygyfhvk commented 1 year ago

image 解决了,是要用compose才行,还要加这句compose true

leavesCZY commented 1 year ago

你这也提醒到我了,我在 wiki 里补充说明了这种情况了