코틀린 멀티플랫폼 Android & iOS 토치앱 만들기
개발/Kotlin2023. 9. 4. 19:56코틀린 멀티플랫폼 Android & iOS 토치앱 만들기

코틀린 멀티플랫폼을 통해 Android/iOS를 연구/개발하면서 슬슬 iOS Platform API를 통해 Native Feature를 다뤄봐야지라는 생각을 하였습니다. 사실 그전까지 안드로이드/데스크탑 위주의 코틀린 멀티플랫폼만을 만들기도 하였고 Swift는 다루지 못하기에 그동안 제한이 있었습니다. 그러다 지난 4월 Swift 공부를 하면서 간단하게나마 개발을 해보자는 생각을 하였고 무엇을 만들까 고민하다 토치(플래시)앱을 주제로 삼았습니다. 결과물 미리보기 Logic Share 범위 설정 우선 가장 먼저 고민한 부분은 토치 기능 뿐만이 아니라 UI까지 컴포즈 멀티플랫폼으로 구현할지, 아니면 UI를 제외한 토치 기능만 코틀린 멀티플랫폼으로 구현할지 고민하였습니다. UI를 제외한 공통된 로직(토치 기능..

RuntimeException - Shortly: The required symbol androidx.compose.runtime/remember
개발/Compose2023. 8. 7. 15:29RuntimeException - Shortly: The required symbol androidx.compose.runtime/remember

컴포즈 멀티플랫폼으로 개발하다보면 아래의 컴파일 오류를 만나는 경우가 있습니다. Shortly: The required symbol androidx.compose.runtime/remember|1835138394250687683[0] is missing in the module or module dependencies. This could happen if the required dependency is missing in the project. Or if there is a dependency that has a different version (without the required symbol) in the project than the version (with the required symbol) ..

ERROR: Compose targets '[uikit]' are experimental and may have bugs!
개발/Compose2023. 8. 1. 15:42ERROR: Compose targets '[uikit]' are experimental and may have bugs!

Compose Multiplatform을 처음 개발하면 다음과 같은 오류를 만나볼 수 있습니다. ERROR: Compose targets '[uikit]' are experimental and may have bugs! But, if you still want to use them, add to gradle.properties: org.jetbrains.compose.experimental.uikit.enabled=true 말 그대로 uikit을 대상으로 하는 컴포즈는 실험적이기에 많은 버그가 있다는 것을 의미합니다. 하지만 우리는 위험을 무릅쓰고 연구/사용을 할 것이기에 가볍게(?) 무시하고 강행하면 됩니다. 위의 오류에서도 설명은 나와있지만 이를 해결하는 방법은 간단합니다. gradle.propert..

Compose iOS: Undefined symbols for architecture arm64
개발/Compose2023. 5. 1. 17:09Compose iOS: Undefined symbols for architecture arm64

Compose Multiplatform을 통해 Compose iOS를 구현하는 경우 매우 높은 확률로 아래의 컴파일 오류를 만날 것 이다. 물론 아래의 시나리오 외에도 발생할 수 있지만 가장 크게 만날 수 있는 오류이다. Undefined symbols for architecture arm64: "_kfun:com.haeyum.crosscomposemobile#HomeScreen(){}", referenced from: _objc2kotlin_kfun:com.haeyum.crosscomposemobile#HomeScreen(){} in shared(result.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command fa..

Compose Android & iOS 통합 UI 연구...1
개발/개발 일기2023. 3. 29. 20:26Compose Android & iOS 통합 UI 연구...1

예전에 해커톤에서 만들었던 기능 중 화면 하나를 Compose로 만들어 보았습니다. (사실 귀차니즘으로 일부는 하드코딩 되어 있습니다) 그렇습니다. iOS에서의 UI도 Compose iOS로 구현되었습니다. UI는 컴포즈. API는 Ktor. 비동기는 Coroutine. iOS에서는 KMM에서 생성된 ComposeView를 draw 해준 것 외 작성된 swift 코드는 전혀 없습니다. (와!) import SwiftUI import shared struct ComposeView: UIViewControllerRepresentable { func makeUIViewController(context: Context) -> UIViewController { IosKt.MainViewController() } ..

Compose iOS 첫 성공
개발/개발 일기2023. 3. 27. 17:33Compose iOS 첫 성공

기존 Skiko를 활용하여 Web 내 순수 Compose 그리는 것에 성공한데 이어 iOS도 성공하였습니다! 다만 iOS는 빌드되지만 AOS 관련하여 빌드 이슈가 발생하기에... (gradle 관련 추가 작업이 필요한데 힘들군요) 아직 추가적인 수정 및 테스트가 필요할 것 같지만 1차적으로 성공하였기에 너무 행복하네요 헤헤 사실 그동안 실패하여 막막하다 이번에 다른 GDSC Lead들과 함께 부산으로 MT오는 길에 KTX 코딩 + 음주 코딩을 통해(?) 성공하였습니다. 역시 무언가 개발하다 막힐 때에는 환경을 변화시키는 것이 새로운 해결책일 수 도 있지 않을까 싶습니다.

image