как котти: < /p>
- Я скачал lottie.xcframework из https://github.com/airbnb/lottie-ios/releases
- Я добавил имя файла lottie.def в папке с именем cinterop в iosmain
- в Build.gradle я добавил этот код:
Код: Выделить всё
iosArm64 {
compilations.getByName("main") {
val Lottie by cinterops.creating {
defFile("src/iosMain/cinterop/Lottie.def")
val path = "$rootDir/libs/Lottie.xcframework/ios-arm64"
compilerOpts("-F$path", "-framework", "Lottie", "-rpath", path)
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
}
listOf(
iosX64(),
iosSimulatorArm64()
).forEach {
it.compilations.getByName("main") {
val Lottie by cinterops.creating {
defFile("src/iosMain/cinterop/Lottie.def")
val path = "$rootDir/libs/Lottie.xcframework/ios-arm64_x86_64-simulator"
compilerOpts("-F$path", "-framework", "Lottie", "-rpath", path)
extraOpts += listOf("-compiler-option", "-fmodules")
}
}
}
< /code>
Но когда я создал эту функцию Compose, и я хочу использовать Lottie, она не импортирует < /p>
import lottie.*
@Composable
actual fun LottieAnimation(
modifier: Modifier,
composition: Any?,
progress: () -> Float,
backgroundColor: Color,
contentScale: ContentScale,
clipToCompositionBounds: Boolean,
) {
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... mp-project