Jan
11/25/2021, 8:44 PMMoritz Post
11/26/2021, 9:41 AMandroidApp
module as "can not find". Is there something not working just yet?MarkRS
11/26/2021, 11:15 AMAlexander Suraphel
11/26/2021, 12:36 PMSkolson5903
11/26/2021, 5:50 PMexpect class Anything(
arg1: String,
arg2: String = ""
) { ... }
actual class Anything(
arg1: String,
arg2: String
) { ... }
val x = Anything("x")
Every usage like this compiles fine in gradle and runs fine, but the IDE wrongly shows the assignment statement as a syntax error. The IDE inspection is going by the actual syntax which is not allowed to duplicate the default value defined in the expect.
I have enough of these that the IDE defect is making me never want to use arguments with default values in an expect class again :-)xxfast
11/27/2021, 12:39 AMpackForXCode
to embedAndSignAppleFrameworkForXcode
, and ever since all the kotlin sources in my swift fails will
error: ambiguous use of 'myKotlinClass'
Am no longer able to jump to definitions of any of my kotlin objects - and pretty sure something went wrong with the new linkages. Is there a way to debug this? using kotlin 1.5.31
oianmol
11/27/2021, 5:26 AMedwinRNDR
11/27/2021, 3:44 PMdarkmoon_uk
11/28/2021, 12:30 PMRahul Rawat
11/28/2021, 7:19 PMval nativeMain by getting {
dependencies {
implementation("io.ktor:ktor-client-curl:$ktorVersion")
implementation("com.squareup.sqldelight:native-driver:$sqlDelightVersion")
}
}
Hannes
11/28/2021, 8:24 PMnative.cocoa
plugin as described here:
https://kotlinlang.org/docs/native-cocoapods.html#install-the-cocoapods-dependency-manager-and-plugin
I’m just trying the code snipped from the docs to use AFNetworking
inside iOSMain (as described in the docs).
kotlin {
...
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
frameworkName = "sharedClient"
podfile = project.file("../iosClient/Podfile")
pod("AFNetworking") {
version = "~> 4.0.1"
}
}
...
}
The problem I am facing right now is that cinteropAFNetworkingIos
fails:
> Task 😒haredClient:cinteropAFNetworkingIos Exception in thread “main” java.lang.Error: /var/folders/n9/5pkml05d7mn3xzdyty8cx5380000gn/T/3707914287112298431.m1️⃣9: fatal error: could not build module ‘AFNetworking’
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:531)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:268)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
> Task 😒haredClient:cinteropAFNetworkingIos FAILEDI think it is more of a cocoa pods issue on my local machine, but I don’t really know how cocoa pods works exactly under the hood. I think cocoa pods did not download AFNetworking. (In a plain iOS / xcode project (not kotlin multiplatform app) I have used successfully cocoa pods, so I think it is fair to assume the required cocoa pods gems are installed on my machine.) Could anyone please point me in the right direction?
Stefan Oltmann
11/29/2021, 9:19 AMval requestSystemPhotoLibraryAccessPermission: suspend () -> SystemPhotoLibraryAccessLevel
suspend lambda. What is the correct way to call this in Swift?
requestSystemPhotoLibraryAccessPermission: {}
gives me an error as soon as I add the suspend keyword: Argument type '() -> ()' does not conform to expected type 'KotlinSuspendFunction0'
What do I need to change?
I don't understand that from the docs. 🙈Stefan Oltmann
11/29/2021, 10:12 AMval requestSystemPhotoLibraryAccessPermissionFlow: () -> Flow<SystemPhotoLibraryAccessLevel>
? Or is just collection of a Flow in iOS code possible?MarkRS
11/29/2021, 12:24 PMAnton Afanasev
11/29/2021, 3:11 PMreconnectFun
. The idea is to trigger that function after some delay (which is incrementing from one attempt to another). The reconnectFun
is passed from the parent class that is responsible for network error listening.
I understand that my problem is that I mutate the attempts
from with in the other thread, as well I call the reconnectFun
but what is the proper way of doing something similar?
internal class ReconnectionManager {
private var attempts = 0
private val dispatcher = CoroutineScope(Dispatchers.Main + SupervisorJob())
fun reconnect(reconnectFun: () -> Unit) {
dispatcher.launch {
delay(attempts * 1000)
withContext(Dispatchers.Default) {
attempts++
reconnectFun()
}
}
}
}
Lukasz Kalnik
11/29/2021, 3:32 PMAdam Brown
11/29/2021, 8:48 PMpod
can't be found. I even went through and installed cocoa pods on windows and it can't find it. Does anyone have an experience with KMM w\ cocoa pods support on windows?Adam Brown
11/29/2021, 9:32 PMandroidMain
source setAdam Brown
11/29/2021, 11:36 PMMatthias Geisler
11/30/2021, 11:34 AMJim
12/01/2021, 12:05 AMwarning: Cannot find annotation method 'xi()' in type 'Metadata'
style errors when using a kmp-jvm library from a java project? I kinda thought using the java
and java-library
plugins would make things "just work"Michal Klimczak
12/01/2021, 8:53 AMFileSystem.SYSTEM
which is only available on `jvm` . It's like everything is there when you have FileHandle
or Sink
, but the first step is vague. Any hints?ptsiogas
12/01/2021, 9:25 AMios-arm64
architecture folder is ~4 times larger than the ios-x86_64-simulator
. For example for a really small project the ios-arm64
folder is ~30MB and for a large project it’s ~75MB.
Hint: we have tried to produce the XCFramework with both the native plugin and the multiplatform-swiftpackage plugin but we got the same size.
Have you noticed anything similar? Is there a way to reduce its size?Lukasz Kalnik
12/01/2021, 1:51 PMAdam Brown
12/01/2021, 8:41 PMAlexandre Brown
12/02/2021, 2:28 AMPavel Repkin
12/02/2021, 8:27 AMlet fileManager = FileManager()
fileManager.unzipItem(at: sourceURL, to: destinationURL)
As far as I know, there is no access in Kotlin to Swift’s FileManager. Instead we have an access to NSFileManager only.
So I’m not able to unzip because FileManager.unzipItem() cannot be called from Kotlin.
Is there a workaround for this problem?Michael
12/02/2021, 4:11 PMTask 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'.
Adding --debug
or --stacktrace
to the task doesn't really help. I usually have to just randomly change things till it starts working. Is there a way to know the specific reason for the task failing. I know for a fact that it's generated when run from XCode
but that's about it. Any debugging tips? 😅
Thanks in advance.
Also. Is the source code available on Github? 🤔Alexandre Brown
12/02/2021, 5:26 PMsettings.gradle.kts
ThanksAnamika Trivedi
12/02/2021, 8:10 PMAnamika Trivedi
12/02/2021, 8:10 PMAlejandro Rios
12/02/2021, 8:27 PMAnamika Trivedi
12/02/2021, 9:40 PMAlexandre Brown
12/03/2021, 12:32 AMAnamika Trivedi
12/03/2021, 2:08 PM