Oste Hovel
04/27/2021, 4:35 PMMichal Klimczak
04/27/2021, 5:26 PM...Protocol
and ...ProtocolMeta
Let's say I have some code that looks like this:
val player = AVAudioPlayer(soundUrl, null)
player.delegate = object : AVAudioPlayerDelegateProtocol{
override fun audioPlayerDidFinishPlaying(
player: AVAudioPlayer,
successfully: Boolean
) {
...
}
}
It complains that it needs to override all these ios NSObjectProtocol methods which is probably not something that I want. But when I try to use AVAudioPlayerDelegateProtocol*Meta*
player.delegate complains that it doesn not conform to AVAudioPlayerDelegateProtocol
Can I make the delegate work without implementing all these weird NSObjectProtocol methods.?Sam
04/27/2021, 6:39 PMnapperley
04/29/2021, 2:04 AMMichal Klimczak
04/29/2021, 3:24 PMdo {
try AVAudioPlayer(contentsOf: url)
} catch {
// handle exception
}
In Kotlin Native it's signature is
public constructor(contentsOfURL: platform.Foundation.NSURL, error: CPointer<ObjCObjectVar<NSError?>>?)
How do you handle error here?Arno Mittelbach
05/01/2021, 12:05 PMjmfayard
05/02/2021, 9:38 AMgit log --oneline
and capture its output and error output.
Any idea how I can do that?jmfayard
05/03/2021, 8:11 AMMichal Klimczak
05/03/2021, 12:45 PMToby
05/04/2021, 11:07 PMNikky
05/05/2021, 8:44 PMptmt
05/06/2021, 9:53 AMaleksey.tomin
05/07/2021, 9:01 AMursus
05/08/2021, 2:46 PMnapperley
05/09/2021, 4:19 AM> Task :linkRandom_numDebugExecutableLinuxX64 FAILED
3 actionable tasks: 3 executed
e: /home/napperley/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold invocation reported errors
The /home/napperley/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1.
output:
/home/napperley/libsodium-1.0.18/lib/libsodium.so: error: undefined reference to 'getentropy', version 'GLIBC_2.25'
/home/napperley/libsodium-1.0.18/lib/libsodium.so: error: undefined reference to '__explicit_bzero_chk', version 'GLIBC_2.25'
/home/napperley/libsodium-1.0.18/lib/libsodium.so: error: undefined reference to 'getrandom', version 'GLIBC_2.25'
I have tried nearly all forms of C library linking (except for statically linking the user ver of the libsodium lib), which includes the following:
• Statically linking the system ver of the lib
• Dynamically linking the system ver of the lib
• Dynamically linking the user ver of the libmboudraa
05/10/2021, 7:55 PMe: Compilation failed: IrTypeAliasSymbol expected: Unbound public symbol for public kotlinx.coroutines/CancellationException|null[0]
* Source files:
* Compiler version info: Konan: 1.5 / Kotlin: 1.5.0
* Output kind: STATIC_CACHE
e: java.lang.IllegalStateException: IrTypeAliasSymbol expected: Unbound public symbol for public kotlinx.coroutines/CancellationException|null[0]
https://kotlinlang.slack.com/archives/C3PQML5NU/p1620671651034400Toby
05/15/2021, 6:40 PMjmfayard
05/15/2021, 8:16 PMval fp = popen(commandToExecute, "r") ?: error("Failed to run command: $command")
val status = pclose(fp)
I have a windows specific bug and I have. no idea where to start
I implemented a function to execute an external command and get its output
It works fine on macOS/Linux but it gives a compilation error on windows
https://github.com/jmfayard/kotlin-cli-starter/runs/2583168375?check_suite_focus=true#step:5:73
https://github.com/jmfayard/kotlin-cli-starter/blob/9d9b6a8081281db159e80574c872048332bc254c/src/nativeMain/kotlin/io/NativeActuals.kt#L20-L49ArcticLampyrid
05/16/2021, 12:55 AMPhilip Dukhov
05/17/2021, 3:28 AMChar.Companion.toChars
marked deprecated, is there any replacement(perfectly available in KMP)?Daniele B
05/17/2021, 5:22 PMnickheitz
05/18/2021, 8:53 AMmbonnin
05/18/2021, 11:42 AM*.knm
file somehow? Something like objdump
but for .klib/.knm ? I'm trying to find a place where I'm referencing an internal symbol from my code.Wietlol
05/18/2021, 9:49 PMMichal Klimczak
05/19/2021, 7:59 AMAvAudioPlayer
which uses a delegate AVAudioPlayerDelegateProtocol
. Now I wanted to just use an anonymous implementation of that protocol (or a class extending it - they both work the same) and set it more or less like this
player.delegate = object : NSObject(), AVAudioPlayerDelegateProtocol
//or
player.delegate = MyOwnAudioPlayerDelegateImpl()
The problem is that the delegate is nullified at random times.
It works if I make the class containing the player extend AvAudioPlayerDelegateProtocol
and then do player.delegate = this
. But it's a bit ugly and creates different issues.
Does anyone know how I can manage memory reliably in the first scenario?Luoqiaoyou
05/20/2021, 8:16 AMalloc<*>
instead.
Is it a way to invoke constructor function when i call alloc<*>
? because the params is final in klib, i can not assign value after alloc<*>
.
my code:
memScoped {
val info = alloc<GrMtlTextureInfo>()
info.fTexture = _texture.objcPtr() // fTexture is final in klib
renderTarget = GrBackendRenderTarget(480, 320, 1, info.reinterpret())
}
Yaniv Sosnovsky
05/20/2021, 12:54 PMArkadii Ivanov
05/20/2021, 6:59 PMCleaner
for automatic resource deallocation! https://github.com/JetBrains/kotlin-native/blob/master/runtime/src/main/kotlin/kotlin/native/internal/Cleaner.ktspierce7
05/20/2021, 11:03 PMHauke Radtki
05/21/2021, 7:24 PM