spierce7
05/21/2021, 9:00 PMkotlin.mpp.enableGranularSourceSetsMetadata=true
work with Android Studio? I tried creating a common sourceset that was common between macosx64 and iosX64 and iosArm64, and I couldn’t get any code completion. Is this expected to work?napperley
05/28/2021, 4:39 AMpublic actual fun saveToBuffer(
type: String,
options: Map<String, String>,
bufferSize: Int,
error: Error?
): Pair<ByteArray, Boolean> = memScoped {
val tmpBuffer = allocArray<CPointerVar<ByteVar>>(bufferSize)
val arraySize = options.keys.size
val keys = allocArray<CPointerVar<ByteVar>>(arraySize)
val values = allocArray<CPointerVar<ByteVar>>(arraySize)
options.keys.forEachIndexed { pos, item -> keys[pos]?.pointed?.value = item.toByte() }
options.values.forEachIndexed { pos, item -> values[pos]?.pointed?.value = item.toByte() }
val errorSet = gdk_pixbuf_save_to_bufferv(
pixbuf = gdkPixbufPtr,
type = type,
error = cValuesOf(error?.gErrorPtr),
option_keys = keys,
option_values = values,
buffer_size = null,
buffer = tmpBuffer
) == TRUE
val buffer = ByteArray(bufferSize)
@Suppress("ReplaceRangeToWithUntil")
(0..(bufferSize - 1)).forEach { pos ->
val item = tmpBuffer[pos]
if (item != null) buffer[pos] = item.pointed.value
}
buffer to errorSet
}
1. Are manually allocated C arrays in Kotlin Native null terminated?
2. Is buffer a shallow copy of tmpBuffer?
3. Is there an easier way to do a shallow copy of a byte buffer that has been manually allocated to a new copy of ByteArray?phisch
05/30/2021, 2:41 PMxcb_change_property(
this.connection,
XCB_PROP_MODE_REPLACE.toUByte(),
window,
windowTypeReply.pointed.atom,
XCB_ATOM_ATOM,
32,
2,
windowTypeDockReply.pointed.atom // THIS needs to be a CValuesRef
)
The windowTypeDockReply
is of the type CPointer<xcb_intern_atom_reply_t>
, which has a property atom
of the type xcb_atom_t
which can be accessed through the pointed property.
The function xcb_change_property
in c needs a xcb_atom_t
as its last parameter. In Kotlin however it requires a kotlinx.cinterop.CValuesRef<*>?
.
So i am wondering how i can make windowTypeDockReply.pointed.atom
into a CValuesRef
?mbonnin
06/01/2021, 7:15 PMphisch
06/02/2021, 2:13 AMmutableListOf
would not be available in the commonMain
namespace?
This is incredibly frustrating, since i think this worked earlier, and now it doesn't. Invalidated caches, restarted IDE and computer, nothing seems to help 😕phisch
06/02/2021, 8:59 PMClocks
06/03/2021, 10:49 PMscavenger5
06/04/2021, 5:29 AMMikołaj Kąkol
06/04/2021, 12:55 PMkotin-coroutines-native-mt
? I’m trying to update to 1.5.0 from 1.4.2, and my tests are failing left and right with mutation attempt of frozen kotlinx.coroutines.flow.StateFlowImpl
caffeine
06/04/2021, 9:23 PMCompilation failed: Symbol for public <http://pw.binom.io|pw.binom.io>.httpClient/HttpClient.request|-4729544346512717501[0] is unbound
Then I renamed HttpClient.request
to HttpClient.connect
and build it.
Then I again try to compile "application" and get error: method request
not found. It is fine, because I renamed method. I fix call request
to connect
in "application" and tryed to build "application" again. And in this turn I got same error: Compilation failed: Symbol for public <http://pw.binom.io|pw.binom.io>.httpClient/HttpClient.request|-4729544346512717501[0] is unbound
Maybe I must clear some cache? I made gradle clean
on both project. It not work.scaventz
06/07/2021, 11:11 AMkotlin-native
but does not seem to take effect. I think it might be helpful to click the load gradle changes
button, but an error was reported, what should I do?Umberto Pompei
06/07/2021, 2:44 PMKamilH
06/08/2021, 5:26 AM0 AudioburstMobileLibrary 0x1035f2f0c kfun:kotlinx.coroutines#<get-mainThread>(){}kotlinx.coroutines.MainThread + 1289996 (Thread.kt:31)
However I don’t have a crash message, so I can’t be sure what might go wrong there.
Is there any way to investigate this problem? Did you ever see something similar to this? The crashes are not reproducible by the client, but it affects like 70 usersJohn O'Reilly
06/08/2021, 7:30 AMnapperley
06/08/2021, 9:55 PMJoakimForslund
06/10/2021, 11:53 AMINC ecx; DEC edx = 41 4a
is the expected outcome. However it always returns
INC ecx; DEC edx = 60 43
Does anyone have an idea to what is going on? Have I done any obvious misstakes or is the generated bindings somehow messing up?John O'Reilly
06/11/2021, 8:37 AMmkrussel
06/11/2021, 2:40 PMmemScoped {
val errorRef = alloc<ObjCObjectVar<NSError?>>()
val result = function(errorRef.ptr)
}
But I get error message saying
None of the following functions can be called with the arguments supplied:
public open fun alloc(size: Int, align: Int): NativePointed defined in kotlinx.cinterop.MemScope
public final fun alloc(size: Long, align: Int): NativePointed defined in kotlinx.cinterop.MemScope
John O'Reilly
06/13/2021, 8:54 AMMichal Klimczak
06/14/2021, 8:44 AMFunction doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
And the stacktrace is obviously rubbish. I cannot pinpoint when it exactly changed, any ideas what might be causing it?altavir
06/17/2021, 7:29 AMcmath
, memeory
etc. How can I link them as well?kpgalligan
06/17/2021, 6:45 PMjoshshin
06/17/2021, 10:44 PM> Task :shared:linkDebugFrameworkIos FAILED
e: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
Please try to disable compiler caches and rerun the build. To disable compiler caches, add the following line to the gradle.properties file in the project's root directory:
kotlin.native.cacheKind=none
Also, consider filing an issue with full Gradle log here: <https://kotl.in/issue>
The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
output:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_FIRDatabase", referenced from:
objc-class-ref in result.o
"_OBJC_CLASS_$_FIRApp", referenced from:
objc-class-ref in result.o
ld: symbol(s) not found for architecture x86_64
FAILURE: Build failed with an exception.
napperley
06/18/2021, 1:39 AMnapperley
06/18/2021, 1:50 AMcapitalthree
06/18/2021, 9:30 AMfun main(args: Array<String>) {
NumbersByBit.values().forEach {
println("The number ${it.name} is: ${it.number.num}")
}
}
enum class NumbersByBit(val number: NumWrapper) {
bb_b(NumWrapper(6)),
bb_c(bb_b.number),
bb_a(bb_b.number),
}
class NumWrapper(val num: Int) {
operator fun plus(other: NumWrapper) = NumWrapper(num + other.num)
}
So is this a bug? Or are self-referential enums out-of-scope for kotlin native?
Update: Based on above messages, I tried kotlin 1.4.31 and the same error occurs.
When I test the binaries with valgrind, I see an invalid read:
The number bb_c is: 6
==895440== Invalid read of size 4
==895440== at 0x443ED1: Init_and_run_start (in /home/alex/IdeaProjects/NativeError/nativeError.kexe_1.5.10~)
==895440== by 0x4A300B2: (below main) (libc-start.c:308)
==895440== Address 0x8 is not stack'd, malloc'd or (recently) free'd
The invalid read error looks the same when running the kotlin 1.4.31 version.Big Chungus
06/19/2021, 1:47 AMNikky
06/19/2021, 11:07 AMdwHighDateTime
and dwLowDateTime
which are there so that a 64 bit value can be split into the lower and upper 32 bit
how would i split a kotlin Long into 2 UInt (DWORD) values ?
or can i just write a Long value to the FILETIME
struct via some unsafe operation ?ushort
06/20/2021, 1:21 AM