spierce7
12/18/2021, 4:31 AMpresentation
. We are migrating usage of it from the xcode buildscripts method to instead use cocoapods. We’re getting an unclear gradle error when building from xcode, and aren’t sure how to fix it. Any help would be appreciated:
* What went wrong:
Task 'Debug' not found in project ':presentation'.
jimn
12/18/2021, 11:38 AMbinaries{executable {...}}
and I found the legend in the Multiplatform doc that says binaries{test{...}}
will perform a "test executable". Has anyone used this?
That seems to be where the documentation trail drops off a steep cliff.
so what i did was to mv
said kt files from LinuxX86Main
to LinuxX86Test
, though i've noticed the results are not supported in intellij gradle dialog to say the very least. When gradle runs testallLinuxX64 it doesn't appear to know or mind not knowing where the native test executables are and how to run them, but it completes successfully. when a given entry of the test executables is linked, they link do consume some cpu fan and cycles.
How does one run "test executables" from gradle?martmists
12/18/2021, 4:50 PMheaders = Python.h
package = python
compilerOpts.windows = /I 'C:\\Program Files\\Python39\\Include'
# ignore this one, it's autogenerated from python sysconfig
compilerOpts.linux = -I'C:\\Program Files\\Python39\\Include'
linkerOpts.linux = -L/usr/lib -l python3
---
struct KtPyObject {
PyObject base;
void* ktObject;
};
I tried this but I get
Exception in thread "main" java.lang.Error: C:\Users\martm\AppData\Local\Temp\1630593588999760275.c:1:10: fatal error: 'Python.h' file not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1189)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1178)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1174)
at org.jetbrains.kotlin.native.interop.gen.jvm.DefaultPlugin.buildNativeIndex(Plugins.kt:31)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:272)
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)
Roeniss Moon
12/18/2021, 5:45 PM./gradlew runDebugExecutableNative
or ./gradlew runReleaseExecutableNative
. My IntelliJ just make a build binaries and said its job done.
On the contrary, in the guide, it looks like the program is running when that commands initiated. So I wonder why my program doesn't work like that.
I'm using macOS m1 (aarch64) v12.0.1, Kotlin v1.6.10 and Intellij v2021.3Andy Victors
12/18/2021, 6:14 PMMiroslav Sobotka
12/19/2021, 4:27 PMRahul Rawat
12/19/2021, 4:33 PMExecution failed for task ':compileSqlDriverNativeMainKotlinMetadata'
w: library included more than once: /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/common/stdlib
w: Could not find "co.touchlab:sqliter-driver-cinterop-sqlite3" in [/Users/rahulrawat/Desktop/Projects/kmp/AddressLibrary, /Users/rahulrawat/.konan/klib, /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/common, /Users/rahulrawat/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.31/klib/platform/ios_arm64]
Tried reverting to 1.5.2 of sqlDelight and kotlin 1.5 but nothing seems to be working.Reuben F
12/19/2021, 7:09 PM/usr/lib/x86_64-linux-gnu/libtinfo.so: error: undefined reference to 'stat', version 'GLIBC_2.33'
is there a list of system dependencies that need to be installed anywhere?martmists
12/19/2021, 7:28 PMPaul Woitaschek
12/20/2021, 2:50 PMnapperley
12/21/2021, 12:21 AMlv_dropdown_set_options
( https://docs.lvgl.io/8.0/widgets/core/dropdown.html?highlight=lv_dropdown_set_options#_CPPv423lv_dropdown_set_optionsP8lv_obj_tPKc ) is used instead of the lv_dropdown_set_options_static
( https://docs.lvgl.io/8.0/widgets/core/dropdown.html?highlight=lv_dropdown_set_options_static#_CPPv430lv_dropdown_set_options_staticP8lv_obj_tPKc ) function then the reserved memory usage increases by about 400 KB, ouch! 🩹 . This is the string literal that is passed through to the function: "Male\nFemale\nOther"
napperley
12/21/2021, 12:49 AMbod
12/22/2021, 9:44 AMkotlin.native.binary.memoryModel=experimental
and not the other ones? Would that even make any sense?tunedal
12/23/2021, 3:33 PMLandry Norris
12/23/2021, 5:59 PMcaffeine
12/24/2021, 9:06 AMexpect class ContextRef
then I try implement this code for linux_x64:
actual typealias ContextRef = LLVMContextRef
in this case i got error because LLVMContextRef
is alias: public typealias LLVMContextRef = kotlinx.cinterop.CPointer<cnames.structs.LLVMOpaqueContext>
okey, it is fine, I forgot about that thing. I try to change my code to actual typealias ContextRef = kotlinx.cinterop.CPointer<cnames.structs.LLVMOpaqueContext>
And i got suddenly error: Type arguments in the right-hand side of actual type alias should be its type parameters in the same order, e.g. 'actual typealias Foo<A, B> = Bar<A, B>'
Why it happend? Why it work fine without expect
and actual
? How I can fix it?Landry Norris
12/28/2021, 9:19 PMbinaries {
executable()
}
val mainCompile = compilations["main"]
mainCompile.cinterops {
val gtk3 by creating
val ffmpeg by creating
}
mainCompile.enableEndorsedLibs = true
spierce7
01/03/2022, 5:58 AMIvan Zinchenko
01/04/2022, 8:24 AM# docker run --rm -it --volume $(pwd):/tool --workdir="/tool" --entrypoint sh adoptopenjdk/openjdk11
# get the kotlin-native cli pack
apt-get update && apt-get install wget
wget <https://github.com/JetBrains/kotlin/releases/download/v1.6.10/kotlin-native-linux-x86_64-1.6.10.tar.gz> && \
tar -xvzf kotlin-native-*.tar.gz && \
rm *.tar.gz && \
mv kotlin-native-* kotlin-native
# test.main.kts only has one line:
# println("Hello from script!")
# compile with kotlinc-native
kotlin-native/bin/kotlinc-native -script test.main.kts -o test
results:
* Source files: test.main.kts
* Compiler version info: Konan: 1.6.10 / Kotlin: 1.6.10
* Output kind: PROGRAM
exception: org.jetbrains.kotlin.util.KotlinFrontEndException: Front-end Internal error: Failed to analyze declaration Test_main
File being compiled: (1,1) in /tool/test.main.kts
The root cause org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException was thrown at: org.jetbrains.kotlin.resolve.lazy.BasicAbsentDescriptorHandler.diagnoseDescriptorNotFound(AbsentDescriptorHandler.kt:18)
...
Caused by: org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration SCRIPT
it should be possible to compile script to native, right?
Thanks in advance for any feedback!spierce7
01/04/2022, 2:52 PMembedAndSignAppleFrameworkForXcode
approach, and now code completion isn’t working for us in xcode for any code from our framework. Where should I be looking to fix this?Anton Afanasev
01/05/2022, 3:39 PMdata class Payload(val name: String)
sealed class Event {
class Inserted(val payload: Payload) : Event()
class Updated(val payload: Payload) : Event()
class UpdatedAll(val payloads: List<Payload>, val flag: Boolean) :
Event()
}
spierce7
01/05/2022, 9:38 PMOut Of Memory: The app was likely terminated by the operating system while in the foreground
0 unknown file unknown method
I’m seeing the following error after running a video player in production for only an hour or so.Stan Potemkin
01/06/2022, 4:35 PMbuild
the app.
However, the run
button currently takes about 3 minutes after any single change, and about 3 seconds if no changes were made.
Executing this:
./gradlew compileKotlinIosX64 --parallel --build-cache -i
Shows that there is a call to:
Run tool: "konanc" with args: -g -ea -target ios_x64 -p library -o <...>
with tens of source files as arguments (every source file, not just modified one)
Is there any possibility to prevent rebuilding shared.klib
from scratch every time?Dmitry Kandalov
01/10/2022, 6:52 PMCGDisplayMode
from macos CoreGraphics in Kotlin (1.6.10)? In particular, I can’t make the following code work:
fun main() {
val displayModes = CGDisplayCopyAllDisplayModes(1, null)!!.toNsArray()
val displayMode = displayModes.objectAtIndex(0)
println(displayMode) // prints <CGDisplayMode 0x600003648840> [{ BitsPerPixel = 32; ... }]
println(displayMode as? CGDisplayMode) // compilation error: java.lang.IllegalStateException: class CGDisplayMode... long stacktrace
println(displayMode as? CGDisplayModeRef) // prints null
println((displayMode as? NSObject)?.className) // prints __NSCFType
}
private fun CFArrayRef.toNsArray() = CFBridgingRelease(this) as NSArray
Landry Norris
01/11/2022, 5:50 PMnapperley
01/13/2022, 3:27 AMFrancesco Pedron
01/13/2022, 3:47 PMcurl_easy_init()
When this line is added I get this error on build:
The C:\Users\Francesco\.konan\dependencies\llvm-11.1.0-windows-x64-essentials/bin/clang++ command returned non-zero exit code: 1.
output:
lld: error: unable to find library -lcurl
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
This is my libcurl.def:
package = libcurl
headers = curl.h
headerFilter = *
linkerOpts.mingw_x64 = -LC:/msys64/mingw64/lib -LC:/Tools/msys64/mingw64/lib -lcurl -L/opt/homebrew/opt/curl/include/curl
compilerOpts.mingw_x64 = -IC:/msys64/mingw64/include/curl -IC:/Tools/msys64/mingw64/include/curl
Please let me know if someone has some clues on how to get it working or if I can provide more information. Thanks.
This is a repo with my current project: https://github.com/francescopedronomnys/kotlin-native-libcurl-dll
Something that I find strange is that this is part of libcurl.def as defined on ktor-client-curl:
linkerOpts.mingw_x64 = -LC:/msys64/mingw64/lib -LC:/Tools/msys64/mingw64/lib -LC:/Tools/msys2/mingw64/lib -lcurl -L/opt/homebrew/opt/curl/include/curl
compilerOpts.mingw_x64 = -I/usr/include/curl -I/usr/include/x86_64-linux-gnu/curl -I/opt/homebrew/opt/curl/include/curl
I do not understand if those paths on compilerOpts.mingw_x64
are correct or just a copy/paste error, to me they don't look like Windows paths and so on my libcurl.def I've set the path where curl's dll, lib and headers are (C:/Tools/msys64/mingw64
)Raed Ghazal
01/14/2022, 1:53 PMclass A {
var x = 5
inner class B {
val x = "upper-class".x
}
}
spierce7
01/17/2022, 6:00 PMmingwX64
and macosX64
. It also uses a library via cinterop that works with Mac and Windows, and shares the same header files. The problem is that in my project, the library ONLY seems accessible in the mingwX64 or the macosX64 source set.
Creating expect/actuals for every single type would be extremely cumbersome. I have kotlin.mpp.enableGranularSourceSetsMetadata=true
. Something tells me this is supposed to work, but I’ve just done something wrong. Should this be working?Rita Okonkwo
01/18/2022, 12:11 PM