Justin
06/10/2022, 3:05 PMJonathan Ellis
06/10/2022, 9:38 PMmiqbaldc
06/11/2022, 9:13 AMAdam Brown
06/12/2022, 1:42 AMNicolas Haan
06/12/2022, 10:07 AMcinterop
but I'm getting an error:
> Task :cinteropIcu4c_iosxIosArm64 FAILED
Exception in thread "main" java.lang.Error: /var/folders/z2/cmdsctqj089dsp264x9j5m3h0000gn/T/16980928468880910640.m:1:9: fatal error: module 'icu4c_iosx' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:274)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:75)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:522)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:285)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:214)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:80)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:40)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:62)
Here is my build.gradle.kts
along with a complete issue reproduction project: https://github.com/nicolashaan/cocoapods-error-repro/blob/main/build.gradle.kts
I've seen that there are some issues with modules with a dash in the name: https://github.com/JetBrains/kotlin-native/issues/2884
I've tried a lot of things from specifying a moduleName
for the pod to modify the podspec of the library with no luck.
Do you have any idea of what can go wrong?spierce7
06/12/2022, 2:10 PMcommon
API that is similar in Java and JS. It involves a tree of content, and each node is exposed through the common API. It’d be nice if I didn’t have to allocate an extra class for each node to properly delegate to each platform (since the trees can be rather large).
Touchlab showed off an interesting approach a few years ago using expect / actual type aliases with extension properties. This doesn’t work in my case because some of the classes in JS aren’t open, or some are interfaces in Java, and classes in JS.
I’m interested if there are any other creative solutions to this that I haven’t thought of.Adam Brown
06/13/2022, 2:35 AMkotlin("plugin.serialization") version "1.6.10"
to my common module blows everything up, gradle starts complaining Caused by: org.gradle.internal.exceptions.DefaultMultiCauseException: Could not resolve all files for configuration ':common:desktopTestCompileClasspath'.
Sebastian Sellmair [JB]
06/13/2022, 11:19 AMJoost Klitsie
06/13/2022, 7:35 PMclark
06/13/2022, 11:18 PMBig Chungus
06/14/2022, 1:56 PMandroidMain
and androidTest
sourceSets? They seem to behave differently to other sourceSets somehow.
For instance, injecting an intermediate sourceSet doesn't seem to work with this hierarchy:
commonMain
jsMain
blockingMain
androidMain
jvmMain
linuxX64Main
I have an actual class in commonMain
which I implement in jsMain
and blockingMain
. This works fine for all the targets EXCEPT android, which complains on compilation
e: /path/File.kt: (11, 24): Expected class 'MyClass' has no actual declaration in module <my-module_release> for JVMI'm adding the dependecies like this
kotlin {
explicitApi()
android {
publishLibraryVariants("release", "debug")
}
sourceSets {
afterEvaluate { // Crashes due to missing sourceSet if we don't do this in afterEvaluate
named("androidMain") {
dependsOn(getByName("blockingMain"))
}
named("androidTest") {
dependsOn(getByName("blockingTest"))
}
}
}
}
Sam
06/14/2022, 3:38 PMMarko Novakovic
06/14/2022, 9:24 PM> Task :shared:compileKotlinIosSimulatorArm64
> Task :shared:linkPodDebugFrameworkIosSimulatorArm64 FAILED
e: Compilation failed: Expecting descriptor for kotlin.time/TimeMark.<init>|-5645683436151566731[0]
* Source files:
* Compiler version info: Konan: 1.7.0 / Kotlin: 1.7.20
* Output kind: STATIC_CACHE
e: java.lang.IllegalStateException: Expecting descriptor for kotlin.time/TimeMark.<init>|-5645683436151566731[0]
at org.jetbrains.kotlin.backend.konan.serialization.KonanIrLinker$KonanCachedLibraryModuleDeserializer.deserializeIrSymbol(KonanIrlinker.kt:635)
andylamax
06/15/2022, 1:11 PMLandry Norris
06/15/2022, 9:58 PMYousef
06/16/2022, 1:42 PMSam
06/16/2022, 1:52 PMHelloWorld
defined in Kotlin, works perfectly from the main swift code but trying to call it from the test target just fails with thisYousef
06/16/2022, 4:28 PMAlina Dolgikh [JB]
Tim Ortel
06/17/2022, 2:31 PMtylerwilson
06/17/2022, 4:50 PMFat frameworks are not supported for platformIs this true, or is my configuration messed up?macos_arm64
Rachel Carandang
06/17/2022, 10:41 PMAli Khaleqi Yekta
06/18/2022, 11:59 AMB
depends on module A
. Module A
has some code inside its commonMain
that module B
can access, because it depends on A
. The thing is, the code inside module A
can be accessed by any sourceSet
of module B
, EXCEPT from androidMain
!!! I can even access the code written in A
from `B`'s jvmMain
, but not androidMain
. When I try to do so, Android Studio (The latest stable version), says:
Unresolved reference: {NameOfTheClass}
---
Add dependency on module '{NameOfMyProject}.A.commonMain'
I don't exactly know when the problem has occurred, but I guess it was after updating the version of some dependencies (especially kotlin 1.6.10 to 1.6.21). I tried changing the versions again and cleaning the project every time; I tried invalidating the caches, I even migrated from a Linux based system to Windows; nothing worked. Some of the current versions:
Android build tools: 33.0.0
app compat: 1.4.2
Kotlin: 1.6.21
coroutines: 1.6.2
Kotlinx Datetime: 0.3.2
Kotlinx Serialization: 1.3.3
core ktx: 1.8.0
activity compose: 1.5.0-rc01
coil: 2.1.0
koin: 3.2.0
jvm targets: 11
compose: 1.1.1
Android gradle: 7.2.1
Kotest: 5.3.0
moko resources: 0.20.1
ktor: 2.0.2
...
UPDATE:
When I downgraded android gradle to 7.1.3, the app successfully compiles and I can run it inside the emulator. However, the IDE still shows the Unresolved dependency error, even though it compiles! How to fix this?
UPDATE:
Downgrading the android gradle plugin to 7.1.3
and adding: kotlin.mpp.hieraricalStructureSupport=false
solved the issue, BUT, made the jb compose not work in `commonMain`s.Ali Khaleqi Yekta
06/18/2022, 12:54 PMkotlin.mpp.hieraricalStructureSupport
is, why is it now enabled by default, and what will I lose if I turn it off? I couldn't get a clear answer reading the description from kotlinlang.org.Javier
06/19/2022, 10:45 AM-jvm
without a workaround. But I can't find it, anyone has it at a hand?Andrew
06/20/2022, 4:33 AMdependencies {
...
implementation project(':myKmpProject')
}
Tlaster
06/20/2022, 6:05 AMtimkranen
06/20/2022, 12:07 PMShowing All Messages
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME -Pkotlin.native.cocoapods.archs="$ARCHS" -Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
due to:
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
I can’t seem to modify the script in the .pubspec to echo the location of $REPO_ROOT, but when I try to run this command from the root of the iOS project it does work. Is there a way to modify the relative path used in the .pubspec to call the gradle task? Seeing how the pubspec file is generated I’m not sure how to go about this.. Not even sure why it’s not working, it could be because I’m using a symlink in the Podfile to link to the shared kmm module?Mohammed Babelly
06/20/2022, 12:43 PM.ipa
app of my kmm ios app?Anton Afanasev
06/20/2022, 1:23 PMfun sendMessage(text: String, customAttributes: Map<String, String> = emptyMap())
translated to this:
func sendMessage(text: String, customAttributes: [String : String] = [:])
Am I seeing write?
kotlin 1.6.10