MarkRS
01/05/2022, 10:50 AMBrian Guertin
01/06/2022, 6:04 PM> Task :jgosdk:linkReleaseFrameworkIosArm64 FAILED
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
ld: library not found for -lSystem
FAILURE: Build failed with an exception.
Akash
01/07/2022, 6:13 PMAkash
01/07/2022, 6:13 PMxxfast
01/18/2022, 9:53 AMExecution failed for task ':app:linkReleaseFrameworkIosX64'.
> Task :login:linkReleaseFrameworkIosX64 FAILED
e: Compilation failed: null
* Source files:
* Compiler version info: Konan: 1.6.10 / Kotlin: 1.6.10
* Output kind: FRAMEWORK
e: java.lang.NullPointerException
at org.jetbrains.kotlin.backend.konan.optimizations.DataFlowIR$SymbolTable.mapClassReferenceType(DataFlowIR.kt:520)
With very little to go on. Should note that it builds successfully for Debug
. Anyone encountered this before? full :wood: in the 🧵Brian Guertin
01/18/2022, 11:06 PMkotlin.collections.HashMap.get
would be causing EXC_BAD_ACCESS
on iOS? It only happens sometimesBrian Guertin
01/19/2022, 4:10 AM-Wl,-stack_size,0x800000
) solved the issue. Sharing in case anyone else has EXC_BAD_ACCESS
issues.Slavi
01/19/2022, 1:51 PMGonçalo Frade
01/24/2022, 9:59 AMPhilipp Bykow
01/25/2022, 2:36 PMFunction doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
and crashes the App. In the class init we call something like this
coroutineScope.launch {
test()
}
The test function is as followed:
@Throws(Exception::class)
private suspend fun test() {
...
}
MarkRS
01/26/2022, 1:07 PMmichaelv
01/28/2022, 6:10 AMmichaelv
01/31/2022, 6:33 AMasync { <viewModel function to run> }
from the view, but from the unit tests it doesn’t do anything using this async {}
syntax since it doesn’t wait for it. It seems that it’s not normal to call it like that in unit tests and just call it with try await
only. However if I do that I get the IncorrectDereferenceException. I’m not sure if it’s currently possible to do it or if I just wasn’t doing it right. I’m not using the new memory model but maybe that would work. It’s not a big deal as I have it working without async/await but I really like the async/await syntax and eventually want to move to it. https://johnoreilly.dev/posts/swift_async_await_kotlin_coroutines/nhaarman
02/02/2022, 4:07 PMStefan Oltmann
02/03/2022, 2:04 PMtask
is always on the main thread.
Task.detached
starts a new task on another thread.
The problem is Task.detached()
runs to completion even is task is cancelled because the cancellation is not propagated.
Can some expert please enlight me how to correctly do that?
.task {
Task.detached {
guard image == nil else { return }
image = await imageLoader.loadThumbnailImage(photoUri: photo.uri)
}
}
Brian Guertin
02/10/2022, 8:30 PMfun myFunc(list: List<*>?): List<*>
// OR
fun myFunc(list: List<Any?>?): List<Any?>
The iOS (Swift) definition is func myList(list: [Any]?) -> [Any]
(not nullable items). Is this a known issue? Any workaround?MarkRS
02/14/2022, 11:44 AMjulien hamon
03/09/2022, 6:25 AM@objc public class CourseImpl: NSObject, Decodable, Course {
let objectID: String
let status: Bool
@objc init(objectID: String,
status: Bool,
title: String
) {
self.objectID = objectID
self.status = status
self.title = title
}
in iosMain
actual fun search(words: String): List<Training> {
val client = SearchClient()
client.initializeWithAppId("", apiKey = "")
client.searchWithText(text = words , indexName = "", callback = { response: List<Course> ->
response.map { it.objectID // don't work }
}.freeze() as (List<*>?) -> Unit)
return listOf(Training(id = "1", name = "name1"), Training(id = "2", name = "name2"))
}
could you help me to undestand ? thanksbrabo-hi
03/11/2022, 4:06 AMMarkRS
03/16/2022, 12:46 PMursus
03/20/2022, 1:09 PMursus
03/20/2022, 10:19 PMVivek Modi
04/14/2022, 11:14 PMlet appVersion = “iOS ” + (Bundle.main.versionNumber ?? “”)
But I don't understand how to use this in iosMain in kmm. Is any other code ?ribesg
04/20/2022, 8:21 AMBUILD SUCCESSFUL in 24m 37s
56 actionable tasks: 47 executed, 9 up-to-date
18:31:05: Execution finished 'build'.
bod
04/28/2022, 9:33 AMNSURLSessionTask.delegate
(this) in Kotlin, but I'm not seeing it. I'm suspecting it may be because it's a recent API that's not yet in Kotlin? (related: wondering how this works actually, does Kotlin keep up with new Apple APIs? Is there a doc with the current version of the APIs that is supports?)Marek Niedbach
05/02/2022, 9:15 AMCryptoKit
will be available in the future as a platform library in the kotlin native ios? Currently there is only CoreCrypto
available which doesn’t have the features I need…Matthew Kruk
05/02/2022, 8:34 PMviewContoller.presentViewContoller(this, animated = true, completion = null)
but it presents as a modal just the same as calling viewController?.presentModalViewController(this, animated = true)
. I've also tried explicitly calling
viewController?.setModalPresentationStyle(UIModalPresentationFullScreen)
with the latter. Any idea what I'm doing wrong?James Black
05/03/2022, 10:14 PMCannot pass function of type '() async -> Void' to parameter expecting synchronous function type
This is the call in iosMain:
actual suspend fun retrieveCurrentForecastByCity(city: String): MonthlyForecast? {
return weatherRepository.retrieveCurrentForecastByCity(city)
}
This code is the action inside a button, but keeping it simple:
await outfitViewModel.currentWeather(city: city)
let a = outfitViewModel.currentWeatherFlow
I can share the repo, but it doesn't compile right now, but basically I call currentWeather, which is a 'suspend' and everything from there is suspend functions. In Android I can use runBlocking { } and and works.
I am using pod 'KMPNativeCoroutinesAsync', '0.12.2' and targeting iOS 15.
Missed one variable. This all works fine on the Android side and everything after this call is in my shared project.
var currentWeatherFlow = MutableSharedFlow<MainTemperature>(1)
Vivek Modi
05/04/2022, 2:28 PMclass KtorCountryApi : NetworkRoute(), KoinComponent {
private val httpClient by inject<HttpClient>()
suspend fun getCountry(): ApiResponse<KtorCountriesResponse> {
val response = httpClient.get {
url("xyz")
}
return apiCall(response)
}
}
NetworkRoute
open class NetworkRoute {
suspend inline fun <reified T : Any> apiCall(httpResponse: HttpResponse): ApiResponse<T> {
return try {
ApiResponse.Success(httpResponse.body())
} catch (e: Exception) {
ApiResponse.Error()
}
}
}
when I am calling in ios code
let ktorApi = KtorCountryApi()
ktorApi.getCountry()
I am getting weird issue 'async' call in a function that does not support concurrency
Vivek Modi
05/05/2022, 2:03 PMcommainMain
interface ApplicationToken {
val accessToken: String
val refreshToken: String
}
iosMain
Platform.kt
lateinit var tokenProvider: ApplicationToken
HttpClient.kt
actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
engine {
configureRequest {
setAllowsCellularAccess(true)
}
}
install(Auth) {
bearer {
loadTokens {
BearerTokens(tokenProvider.accessToken, "")
}
}
}
}
Now when I am to access tokenProvider
in my swift code. It cannot find. I am adding image please have a look.Vivek Modi
05/05/2022, 2:03 PMcommainMain
interface ApplicationToken {
val accessToken: String
val refreshToken: String
}
iosMain
Platform.kt
lateinit var tokenProvider: ApplicationToken
HttpClient.kt
actual fun httpClient(config: HttpClientConfig<*>.() -> Unit) = HttpClient(Darwin) {
config(this)
engine {
configureRequest {
setAllowsCellularAccess(true)
}
}
install(Auth) {
bearer {
loadTokens {
BearerTokens(tokenProvider.accessToken, "")
}
}
}
}
Now when I am to access tokenProvider
in my swift code. It cannot find. I am adding image please have a look.Landry Norris
05/05/2022, 6:36 PMVivek Modi
05/05/2022, 7:54 PM