Dmytro Boiko
11/15/2023, 7:02 PMलातों वाला भूत
11/16/2023, 5:06 PMDmytro Boiko
11/16/2023, 5:11 PMलातों वाला भूत
11/16/2023, 5:20 PM@OptIn(ExperimentalForeignApi::class)
@Composable
actual fun Lottie(
modifier: Modifier,
animationRes: AssetResource,
isPlaying: Boolean,
isInfinite: Boolean,
contentScale: ContentScale,
speed: Float,
onComplete: (() -> Unit)?
) {
var animation by remember { mutableStateOf<CompatibleAnimation?>(null) }
LaunchedEffect(Unit) {
animation = CompatibleAnimation(
name = animationRes.fileName,
subdirectory = null,
animationRes.bundle
)
}
when (val value = animation) {
null -> {}
else -> {
UIKitView(
modifier = modifier,
factory = {
UIView().apply {
backgroundColor = UIColor.clearColor
opaque = true
setClipsToBounds(true)
}
},
background = MaterialTheme.colorScheme.surface,
update = {
val view = CompatibleAnimationView()
view.translatesAutoresizingMaskIntoConstraints = false
it.addSubview(view)
NSLayoutConstraint.activateConstraints(
listOf(
view.widthAnchor.constraintEqualToAnchor(it.widthAnchor),
view.heightAnchor.constraintEqualToAnchor(it.heightAnchor)
)
)
view.setAnimationSpeed(speed.toDouble())
view.setCompatibleAnimation(value)
view.setLoopAnimationCount(if (isInfinite) -1.0 else 1.0)
view.setContentMode(UIViewContentMode.UIViewContentModeScaleAspectFit)
view.playWithCompletion { completed ->
if (completed) onComplete?.invoke()
}
}
)
}
}
}
Dmytro Boiko
11/16/2023, 5:24 PMलातों वाला भूत
11/16/2023, 5:25 PMDmytro Boiko
11/16/2023, 5:25 PMलातों वाला भूत
11/16/2023, 5:27 PMpod("lottie-ios") {
version = "4.3.3"
moduleName = "Lottie"
extraOpts += listOf("-compiler-option", "-fmodules")
}
Dmytro Boiko
11/16/2023, 5:27 PMld: Undefined symbols:
_OBJC_CLASS_$__TtC6Lottie19CompatibleAnimation, referenced from:
in ComposeApp[arm64][2](ComposeApp.framework.o)
_OBJC_CLASS_$__TtC6Lottie23CompatibleAnimationView, referenced from:
in ComposeApp[arm64][2](ComposeApp.framework.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
लातों वाला भूत
11/16/2023, 6:41 PMframework {
baseName = "shared"
isStatic = true
}
Do you have isStatic = true?Dmytro Boiko
11/16/2023, 6:59 PMlistOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "ComposeApp"
isStatic = true
binaryOption("bundleId", "...")
}
}
लातों वाला भूत
11/16/2023, 11:05 PMDmytro Boiko
11/17/2023, 8:56 AMलातों वाला भूत
11/17/2023, 9:37 AMDmytro Boiko
11/17/2023, 9:38 AMलातों वाला भूत
11/17/2023, 9:38 AMDmytro Boiko
11/17/2023, 9:40 AMलातों वाला भूत
11/17/2023, 9:42 AMDmytro Boiko
11/17/2023, 9:44 AMcocoapods {
summary = "ComposeApp KMM"
homepage = ""
version = "11.0"
ios.deploymentTarget = "16.2"
noPodspec()
pod("lottie-ios") {
source = git("<https://github.com/airbnb/lottie-ios>") {
branch = "master"
}
moduleName = "Lottie"
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
लातों वाला भूत
11/17/2023, 9:45 AMDmytro Boiko
11/17/2023, 9:48 AMld: warning: Could not find or use auto-linked framework 'Lottie': framework 'Lottie' not found
ld: Undefined symbols:
_OBJC_CLASS_$__TtC6Lottie19CompatibleAnimation, referenced from:
in composeApp[arm64][2](composeApp.framework.o)
_OBJC_CLASS_$__TtC6Lottie23CompatibleAnimationView, referenced from:
in composeApp[arm64][2](composeApp.framework.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
target 'iosApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for iosApp
platform :ios, '16.2'
pod 'composeApp', :path => '../composeApp'
end
लातों वाला भूत
11/17/2023, 10:10 AMDmytro Boiko
11/17/2023, 10:30 AMलातों वाला भूत
11/17/2023, 10:34 AMDmytro Boiko
11/17/2023, 10:35 AMलातों वाला भूत
11/18/2023, 8:29 PMDmytro Boiko
11/19/2023, 7:51 AM