Теперь, когда я создаю проект, он собирается хорошо и запускает приложение из студии Android. Но когда я создаю подписанный APK, он терпит неудачу и выдает мне ошибку. Неразрешенная ссылка «AnchoredDraggableDefaults. Почему?
Я использую это в коде как
Код: Выделить всё
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun someFunction(){
val swipeState = remember {
AnchoredDraggableState(
initialValue = false,
anchors = DraggableAnchors {
false at 0f
true at endPx
}
)
}
Box(
modifier = Modifier
.offset {
// Safety check to ensure offset is read only after layout/initialization
val offset = try {
swipeState.requireOffset()
} catch (e: Exception) {
0f
}
IntOffset(offset.roundToInt(), 0)
}
.size(handleSize)
.padding(4.dp)
.clip(CircleShape)
.background(MaterialTheme.colorScheme.primary)
.anchoredDraggable(
state = swipeState,
orientation = Orientation.Horizontal,
flingBehavior = flingBehavior,
),
contentAlignment = Alignment.Center
){
//some code
}
val flingBehavior = AnchoredDraggableDefaults.flingBehavior(
state = swipeState,
positionalThreshold = { distance -> distance * 0.5f },
animationSpec = spring(
dampingRatio = Spring.DampingRatioLowBouncy,
stiffness = Spring.StiffnessLow
)
)
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... signed-apk
Мобильная версия