Marc
02/28/2025, 2:40 PM@Throws
annotation on the Kotlin side and now wrapped the Swift side with a
do {
try await operation()
} catch let e as NSError {
...
}
block. Catching the exception kind of works as I can see logs from inside the catch block, but my app still crashes from the already caught and handled exception, saying that it is uncaught. Why is that happening?darkmoon_uk
03/02/2025, 11:10 AMObserving
View? Asking because I have a perplexing result... The view receives emissions if I start the Flow SharingStarted.Eagerly
, but if I set it to WhileSubscribed
it never starts...
So is Observing
subscribing or not 🤔Enol Simón
03/02/2025, 3:24 PMMeherdatta Chepuri
03/05/2025, 7:47 PMShageldi Alyyev
03/06/2025, 6:30 AMShageldi Alyyev
03/06/2025, 6:34 AMPatryk Drozd
03/10/2025, 11:33 AMNWPathMonitor
and listen to enum changes NWInterface.InterfaceType
. But I can’t do that on KMP side? Anyone have any tips here?Saurabh Gupta
03/13/2025, 5:22 PMJohn O'Reilly
03/25/2025, 5:39 PMYuvaraj
03/27/2025, 3:37 AMDovydas
03/27/2025, 4:02 PMMikolaj
03/28/2025, 9:30 AMAppDelegate
(didFinishLaunchingWithOptions, didReceiveRemoteNotifications) and UNUserNotificationDelegate
on kotlin side as well as in swift but with no luck. 🤔
This is a case of user opening app by tapping notification when app was closed completly (not in background)Patryk Drozd
04/01/2025, 12:17 PMSwiftChachaPoly
on the internet but it's outdated. Here is my error and Gradle File.
Error Message
Exception in thread "main" java.lang.Error: /var/folders/4m/c90drcr50gsghb8p86fnn51r0000gp/T/17669576026474868801.m:1:10: fatal error: 'AppleBridge/AppleBridge-Swift.h' file not found
Failed to generate cinterop for :shared:cinteropAppleBridgeIosArm64: Process 'command '/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1
:shared:iosArm64Main: cinterop file: /Users/patrykdrozd/Programing/dms-agent/shared/build/libs/shared-iosArm64Cinterop-AppleBridgeMain-1.0.0.klib does not exist
etc
Gradle File
listOf(
iosArm64(),
iosSimulatorArm64(),
).forEach {
it.binaries.framework {
baseName = "shared"
isStatic = true
binaryOption("bundleId", "shared")
}
val platform = when (it.name) {
"iosArm64" -> "iphoneos"
"iosSimulatorArm64" -> "iphonesimulator"
else -> error("Unsupported target ${it.name}")
}
it.compilations.getByName("main") {
cinterops.create("AppleBridge") {
val interopTask = tasks[interopProcessingTaskName]
interopTask.dependsOn(":AppleBridge:build${platform.replaceFirstChar(Char::titlecase)}")
includeDirs.headerFilterOnly("$rootDir/AppleBridge/build/Release-$platform/include")
}
}
}
AppleBridge.def File
language = Objective-C
package = swift.appleBridge
headers = AppleBridge/AppleBridge-Swift.h
headerFilter = AppleBridge/*
staticLibraries = libAppleBridge.a
libraryPaths.ios_x64 = AppleBridge/build/Release-iphonesimulator
libraryPaths.ios_simulator_arm64 = AppleBridge/build/Release-iphonesimulator
libraryPaths.ios_arm64 = AppleBridge/build/Release-iphoneos
linkerOpts = -L/usr/lib/swift
linkerOpts.ios_x64 = -ios_simulator_version_min 13.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/
linkerOpts.ios_simulator_arm64 = -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/
linkerOpts.ios_arm64 = -iphoneos_version_min 13.0 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/
Update
I found that my Xcode project doesn't create folder with a header Debug-iphoneos/include/*-Bridging-Header.h
John O'Reilly
04/01/2025, 12:32 PMidevicesyslog
for example but not showing the logs for some reasonMikolaj
04/03/2025, 12:34 PMUndefined symbols for architecture arm64
. Anybody knows how to resolve this? I did not change anything and the build ran fine yesterday 🤔Patryk Drozd
04/07/2025, 2:28 PMPatrick Cavanagh
04/10/2025, 8:27 PMdarkmoon_uk
04/12/2025, 10:40 PMshared
Kotlin symbols are visible and navigable from Xcode âś…
When building for simulator in Xcode, compilation result remains correct, but Kotlin symbols are unresolvable to the Xcode IDE đź™…
Is there some search path or configuration that can be added to enable awareness of symbols from simulator build paths?Patryk Drozd
04/15/2025, 8:58 AMthows
with kotlin.
Swift
@objcMembers public class AESCryptoBridge: NSObject {
public func test() throws {
throw CryptoError.invalidData
}
}
On Kotlin I have access to NSError but I have no idea how to use is. Is there any resource that will explain me how to work with?
AESCryptoBridge().testAndReturnError("I have no idea how to use NSError Pointer here")
I found this code but alloc is deprecated if I am correct
val errorPointer: CPointer<ObjCObjectVar<NSError?>> = alloc<ObjCObjectVar<NSError?>>().ptr
Update: I found the solution 🙂
val error = memScoped {
allocPointerTo<ObjCObjectVar<NSError?>>()
}
AESCryptoBridge().testAndReturnError(error.value)
Dovydas
04/16/2025, 5:17 PMFrançois
04/19/2025, 8:29 AMcd "${SRCROOT}/../shared/build/xcode-frameworks/"
(or any other path to the shared framework
• ln -Fs "${CONFIGURATION}" "Debug"
A Debug directory is mandatory for SOURCE_KIT to work!Dovydas
04/20/2025, 3:28 PMchandilsachin
04/22/2025, 12:19 PMMarc
04/22/2025, 2:33 PMMax
04/22/2025, 6:27 PMMainViewController.kt
class like below.
Afterwards I can access IOSPlatformFile
in Swift code.
fun MainViewController() = ComposeUIViewController { App() }
// so swift code can access this
val platformFile: IOSPlatformFile = IOSPlatformFile("")
Could someone clarify what I’m doing wrong in these cases? Are only classes from the main module visible to Swift by default?Hasan Nagizade
05/02/2025, 6:50 AMGNKumar
05/02/2025, 1:40 PMMikolaj
05/06/2025, 1:40 PMembedAndSign
run faster (besides buy new computer)? I'm not using cocoapods nor SPM, only kotlin (and minimum swift boilerplate) yet full ios build still takes 20-30 minutes (macbook M3 16GB ram)
*embedAndSign takes >50% of that timeFarhazul Mullick
05/07/2025, 9:24 AMkotlin native cocoapods
. I have few questions.
1. Why kotlin native cocoapods plugin automatically creates podspec file upon sync.
2. If i use some cocoapods dependency and like Alamofire. I can define in gradle inside cocoapods block. Upon gradle sync podInstall task is ran by gradle. Then kotlin files of those pods are generated from cocoapods package. This later compiled with the final fat-framework. We can use this framework in any ios app. If so why we need to create a pod file in iosApp and run pod install there as well?abraham
05/09/2025, 2:43 PMswift_name
attributes?