Brian Guertin
02/23/2022, 3:14 AMOS Version: iOS 14.6
(anonymous namespace)::ExceptionObjHolderImpl:
0 unknown file unknown method
Wyatt Kennedy
02/24/2022, 9:56 PMmingwX64 {
this.compilations["main"].cinterops {
create("test") {
packageName = "github.fatalcatharsis.test"
includeDirs.allHeaders(project.rootDir.resolve("headers"))
extraOpts("-libraryPath", "${project.rootDir}/src/mingwX64Main/resources/", "-staticLibrary", "test.a")
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val nativeMain by creating {
dependsOn(commonMain)
}
val mingwX64Main by getting {
dependsOn(nativeMain)
}
}
Code that I put in src/mingwX64Main/kotlin gets highlighted properly and builds using the definitions in my c header. But nativeMain obviously does not. Is there any way to have the header bindings available to a shared source set?jean
02/25/2022, 9:53 AMkotlin::FormatToSpan(kotlin::std_support::span<char, 18446744073709551615ul>, char const*, ...) + 4354272500
to be the culprit. I have no Idea how to find what causes this, how should I proceed?Nikky
02/25/2022, 11:18 AMWietlol
02/25/2022, 11:02 PMval hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows")
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native")
hostOs == "Linux" -> linuxX64("native")
isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
nativeTarget.apply {
binaries {
executable {
entryPoint = "main"
}
}
}
which works and generates a windows ".exe" file
I can also change the first line to a literal "Linux"
(to pretend I am on a linux) and it works and generates a linux ".kexe" file
but I can't figure out how to make it generate both a linux ánd a windows executableWietlol
02/26/2022, 12:31 AMInstall the curl libraryhowever, I am a bit confused and annoyed by this step as 1, this shouldnt be necessary, developers shouldnt download and install arbitrary things just to make their machine able to build a project, this is literally what tools like gradle are meant for, why is this not handled by gradle?! 2, the link is just a download page, which gives absolutely no information as to how to "install" (pretending that even makes sense) the package 3, I have curl already "installed"
Tristan
02/26/2022, 2:25 AM./gradlew linkNative
) I get an error when I return null
in a function, such as:
// commonMain
interface GetManufacturerUseCase {
operator fun invoke(): String?
}
// nativeMain
class GetManufacturerUseCaseImpl : GetManufacturerUseCase {
override fun invoke() = null
}
It produces this error
/var/folders/v4/tsnbm2mj12qcqd5mzx022z0m0000gp/T/konan_temp15915856283221827637/api.cpp:482:21: error: unknown type name 'libNative_kref_kotlin_Nothing'; did you mean 'libNative_kref_kotlin_Long'?
libNative_kref_kotlin_Nothing (*invoke)(libNative_kref_com_me_myproject_deviceInfo_domain_usecase_GetManufacturerUseCaseImpl thiz);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libNative_kref_kotlin_Long
To fix it, I return an empty string 😕 But that’s not really what I want.
Is this a bug, or a limitation?Chachako
02/27/2022, 6:01 PMTristan
03/02/2022, 12:56 AMMateusz Apacki
03/02/2022, 7:38 AMribesg
03/02/2022, 10:32 AMcocoapods
block in my gradle build file. It generates a podspec file. I then reference this podspec file from the Podfile of an XCode project. Now, in a Swift file in the XCode project, I seem to be able to import the dependencies of my app defined in my cocoapods
block, but not my own Kotlin code. Anyone knows how this is supposed to work?Wietlol
03/03/2022, 2:03 AMribesg
03/03/2022, 10:15 AM[String]
to a Kotlin function taking an Array<String>
(exposed to Swift as KotlinArray<NSString>
)?Dragos Rachieru
03/07/2022, 2:01 PMsourceSet
called desktopMain
like in this example
The problem I'm facing, is that platform.posix.popen
and platform.posix.pclose
are not available in the shared sourceSet
.
Any idea why it is not resolved?Francesco Pedron
03/07/2022, 4:48 PMThe C:\Users\Francesco\.konan\dependencies\llvm-11.1.0-windows-x64-essentials/bin/clang++ command returned non-zero exit code: 1.
output:
lld-link: error: undefined symbol: CanalGetDllVersion
>>> referenced by Z:\BuildAgent\work\6326934d18cfe24e\kotlin\libraries\stdlib\src\kotlin\util\Result.kt:0
>>> C:\Users\FRANCE~1\AppData\Local\Temp\konan_temp5544792713254776830\result.o:(libusbtocan_CanalGetDllVersion_wrapper14)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
FAILURE: Build failed with an exception.
Idea is able to resolve libusbtocan methods, so it looks like the linker (?) should be able to resolve that symbol.
Do you have any hint? Thanks.Landry Norris
03/07/2022, 5:44 PMnapperley
03/08/2022, 12:58 AMe: Module "io.gitlab.embed-soft:lvglkt-sdl2 (io.gitlab.embed-soft:lvglkt-sdl2-linuxx64)" has a reference to symbol lvgl/lv_tick_inc|-852571541272050155[100]. Neither the module itself nor its dependencies contain such declaration.
This could happen if the required dependency is missing in the project. Or if there is a dependency of "io.gitlab.embed-soft:lvglkt-sdl2 (io.gitlab.embed-soft:lvglkt-sdl2-linuxx64)" that has a different version in the project than the version that "io.gitlab.embed-soft:lvglkt-sdl2 (io.gitlab.embed-soft:lvglkt-sdl2-linuxx64): 0.3.0" was initially compiled with. Please check that the project configuration is correct and has consistent versions of all required dependencies.
The list of "io.gitlab.embed-soft:lvglkt-sdl2 (io.gitlab.embed-soft:lvglkt-sdl2-linuxx64): 0.3.0" dependencies that may lead to conflicts:
1. "io.gitlab.embed-soft:lvglkt-core (io.gitlab.embed-soft:lvglkt-core-linuxx64): 0.3.0" (was initially compiled with "io.gitlab.embed-soft:lvglkt-core (io.gitlab.embed-soft:lvglkt-core-linuxx64): 0.2.0")
2. "io.gitlab.embed-soft:lvglkt-drivers (io.gitlab.embed-soft:lvglkt-drivers-linuxx64): 0.3.0" (was initially compiled with "io.gitlab.embed-soft:lvglkt-drivers (io.gitlab.embed-soft:lvglkt-drivers-linuxx64): 0.2.0")
Tried to resolve the issue by clearing out the local Maven repository cache (in ~/.m2/repository), republishing the libraries, and rebuilding the Linux X64 binary however the same issue occurs. I'm wondering if the sample project referencing two Maven repositories (Maven Central & Maven Local) could cause this issue. @Artyom Degtyarev [JB]Jon Bailey
03/08/2022, 1:28 PM./gradlew :shared:embedAndSignAppleFrameworkForXcode
in a run script build phase in Xcode. Is there a way to change the output format of the errors from kotlin compiler (or gradle?) so that they show up as errors in Xcode? Currently I’m using sed like this: ./gradlew :shared:embedAndSignAppleFrameworkForXcode 2> >(sed 's_^e: \([^:]*\): (\([0-9]*\), \([0-9]*\)): \(.*\)_&\n\1:\2:\3: error: \4_g' >&1)
which is a bit ugly but works. It seems like there should be a way to tell the kotlin compiler/gradle directly what format to use?Joaquim
03/10/2022, 7:00 AMtheapache64
03/13/2022, 8:07 AMreadln
fails in IDE but works in terminal. Any idea how I can fix this? 🤔Landry Norris
03/14/2022, 8:36 PMUIStoryboard.storyboardWithName(storyboardName, null).instantiateInitialViewController()
and calling view.addSubview on the main view of the resulting ViewController in my Kotlin ViewController. This works fine, and I’ve set up nice extension functions for this, but I’m seeing that the Safe Area is ignored. I set up rotation lately, reloading the storyboard on device rotation, and I noticed that the Safe Area works this time. Has anyone tried something similar and run into the same issues?Raed Ghazal
03/15/2022, 6:14 PM@ColorRes, @ColorInt
fun Int.doSomthing(): Int {
return getColor(this)
}
so the extension function is for @ColorRes Int, and the return type is @ColorInt
if I annotate the function with @ColorRes it will take it as a return type annotation but I can’t seem to find how to annotate the main class the extension is made ofSam
03/16/2022, 4:44 PMembedAndSignAppleFrameworkForXcode
task. I’m trying to break on a line in a Swift file. It’s always a little slow to initialize the debugger when hitting a breakpoint in a Swift file. In the newest Xcode it just spins forever. Loading up a copy of Xcode 13.1 still works.Landry Norris
03/17/2022, 7:50 PMCPointer<[ERROR : Unknown type parameter 0. Please try recompiling module containing "[container not found]"]>
. I know that the types are AVStream, and that AVStream is recognized by Kotlin. This seems to occur when using the get(index) extension provided by the cinterop package. Has anyone run into this issue before? [Fixed by downgrading Kotlin from 1.6.20-RC to 1.6.10]russhwolf
03/17/2022, 10:00 PMframework
block like
kotlin {
cocoapods {
framework {
...
}
}
}
I get an ambiguous method overload error. Looking at the tests in the kotlin native repo, I don't see anything that calls framework
so maybe it's a bug.Nikky
03/21/2022, 12:14 PMmkrussel
03/23/2022, 3:26 PM.def
files used for cinterop
? I can find examples but nothing that lists all the properties and what they can have as values.Leon Kiefer
03/29/2022, 11:41 AMfun foo(args: List<*>)
the args list contains many different types of arguments (Strings, Int, Bool, Callbacks). This function foo is called from Native code on ios. If a Callback(function pointer in native code) is part of the args list, kotlin converts it to a Double and we don't know how to call it in kotlin. The args parameter is very generic, because this is part of a framework integration project, which also uses code generation and so we have to handle the dynamic list of parameters at runtime.Landry Norris
03/31/2022, 9:15 PMAlexandre Brown
04/01/2022, 7:29 PMAlexandre Brown
04/01/2022, 7:29 PMBig Chungus
04/01/2022, 7:35 PMAlexandre Brown
04/01/2022, 7:37 PMBig Chungus
04/01/2022, 7:39 PMAlexandre Brown
04/01/2022, 7:40 PMBig Chungus
04/01/2022, 7:41 PMAlexandre Brown
04/01/2022, 7:41 PMBig Chungus
04/01/2022, 7:41 PMAlexandre Brown
04/01/2022, 7:42 PMBig Chungus
04/01/2022, 8:06 PMAlexandre Brown
04/01/2022, 8:07 PM.c
files?Big Chungus
04/01/2022, 8:08 PM