GarouDan
06/13/2020, 12:24 PMThere are 132 libraries libraries from the Kotlin/Native 1.3.61 distribution attached to the project: stdlib, AVFoundation, AVKit, Accelerate, Accounts, ... These libraries were compiled with an older Kotlin/Native compiler and can't be read in IDE. Please edit Gradle buildfile(s) to use Kotlin Gradle plugin version 1.4-M2. Then re-import the project in IDE.
I’m already using Kotlin 1.4-M2
but it looks like Kotlin/Native still keeps downloading this version. How can I force it to use 1.4-M2
?
I’m using Gradle with KTSGarouDan
06/13/2020, 10:21 PMplatform.posix.system(command)
?
I’d like to get the output or the error, like we do with the inputStream and errorStream for jvm.
I tried to find inside of the repo but it is difficult to locate it therealeksey.tomin
06/15/2020, 12:45 PM@SharedImmutable
var APPENDER: Appender = ConsoleOutputAppender
And I have error
kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
...
at 6 app.kexe 0x00000001022aae84 kfun:mu.<get-APPENDER>()Appender + 100 (File.kt:10:1)
on read this variable.
But why? @SharedImmutable
was added.Justin
06/15/2020, 8:00 PMcom.intellij.execution.ExecutionException: No configuration for executable=KonanExecutableBase(targetType=ios_x64, targetName=iOSSim, executableName=test, projectPrefix=:flowdriver:)
at com.jetbrains.mpp.debugger.GradleLLDBBackend.binaryConfiguration(GradleLLDBBackend.kt:21)
at com.jetbrains.mpp.debugger.GradleLLDBBackend.binaryConfiguration(GradleLLDBBackend.kt:16)
at com.jetbrains.mpp.debugger.LLDBBackendBase.debugConfigurationSettings(LLDBBackendBase.kt:95)
at com.intellij.openapi.externalSystem.service.execution.ForkedDebuggerThread.handleForkedProcessSignal(ForkedDebuggerThread.java:143)
at com.intellij.openapi.externalSystem.service.execution.ForkedDebuggerThread.run(ForkedDebuggerThread.java:102)
Notably, when I tried to run these tests the first time, an Xcode dialog popped up asking for my password to give permission for xcrun
(or something like that) and I accidentally clicked cancel and dismissed the prompt.
Is it possible that I need to somehow reset that prompt so I can enter my password and fix this?napperley
06/16/2020, 1:47 AMMananpoddarm
06/16/2020, 5:55 AMVsevolod Ganin
06/16/2020, 3:20 PMinit
s supported? As I can see, Kotlin interop nullable init methods are deprecated in favor of constructors but constructors cannot produce null
, do they? Am I missing something? For example: https://developer.apple.com/documentation/foundation/nsurl/1413146-initChristian Sousa
06/16/2020, 4:19 PMprivate fun getDataFromUrl(url: NSURL) {
NSURLSession.sharedSession.dataTaskWithURL(
url = url,
completionHandler = ::getCompletion.freeze()
).resume()
}
So with this, I will get data from a URL
After that, with my getCompletion
fun getCompletion(data: NSData?, response: NSURLResponse?, error: NSError?){
var downloadedImage = UIImage(data = data)
logo.setImage(image = downloadedImage)
logo.setHidden(false)
}
Where my logo is a UIImage.
Problem is, the getCompletion
is being called from a background thread and I’m trying to update something on the main thread.
Is there any way of doing this?
The goal is to be able to download the image asynchronously and after that, update the image I already have.
What I’m getting as an error is the following:
Main Thread Checker: UI API called on a background thread: -[UIImageView setImage:]
Derek Ellis
06/16/2020, 4:21 PMMananpoddarm
06/16/2020, 5:46 PMDraget
06/16/2020, 8:04 PMaleksey.tomin
06/17/2020, 4:51 AMsleep
?
Worker.start().execute(TransferMode.SAFE, {}) {
...
??? sleep(100u)
}
On MacOS sleep
leads error flock failed to lock maps file: errno = 35
delay
doesn’t allowed out of coroutine.basher
06/17/2020, 7:15 PM/
dazza5000
06/18/2020, 12:06 AMMananpoddarm
06/18/2020, 5:42 AMTfLiteTensorCopyFromBuffer(input_tensor, inputs as CValuesRef<*>, inputs.size as ULong)
"inputs" is of type Array<Any>. I want to extract the data from this "inputs" and feed it to tensorflow function(I am using cinterop to access tensorflow C API) but in runtime it throws me error as Array<Any> cannot be typecasted to CValuesRef<*>. I am asssuming there must be some function like "inputs.data" or something which can do the job. could anyone help me here please?aleksey.tomin
06/18/2020, 7:32 AMCLLocationManager.requestAlwaysAuthorization
on start.
It works from IDEA or command line.
But when I make PKG file by this and create Info.plist file.
If I add into file
<key>NSLocationUsageDescription</key>
<string>My information</string>
application doesn’t use message, ask me any time, write info console the error
app.kexe[31495:7080886] There was an error parsing the Info.plist for the bundle at URL <....>: NSCocoaErrorDomain - 3840
and CAN’T get gps info.
If I add into file
<key>NSLocationAlwaysUsageDescription</key>
application ask me ONE time, write info console the same error
app.kexe[31495:7080886] There was an error parsing the Info.plist for the bundle at URL <....>: NSCocoaErrorDomain - 3840
and GETS gps info.
But Launchpad ignored my app 🤯
What have I to do?Tijl
06/19/2020, 10:20 AMMananpoddarm
06/19/2020, 12:50 PMheaders = cinterop/c_interop/native/native.h
linkerOpts.mingw = -Lwindows_x86_64/native.lib
how should I put the relative path in headers(in windows.def file)? my directory structure is Intellligence/src/nativeInterop/cinterop/windows.def
my build.gradle is in Intelligence/build.gradlekatokay
06/20/2020, 5:29 PMtypealias Reducer<TState> = (TState, Action) -> TState
@OptIn(ExperimentalCoroutinesApi::class)
open class KStore<TState:Any>(initialState: TState, private val reducer: Reducer<TState>) {
private val state = MutableStateFlow(initialState)
private fun currentState() = state.value
private fun setState(newState: TState) {
state.value = newState
}
fun dispatch(action: Action) {
val currentGetter: () -> TState = ::currentState
val stateSetter: (TState) -> Unit = ::setState
val stateChanges = when(action) {
is FlowAction -> action.toFlow()
else -> flow { emit(action )}
}.map {
reducer(currentGetter(), it)
}.flowOn(Dispatchers.Default)
println("Got state changes")
stateChanges.onEach {
stateSetter(it)
}.launchIn(UIScope())
}
//callback method for pushing back to swift, hopefully a better alternative can be found
fun listen(onStateChange: (TState) -> Unit) = runBlocking {
state.onEach {
onStateChange(it)
}.launchIn(UIScope())
}
}
Mananpoddarm
06/21/2020, 12:29 PMChilli
06/21/2020, 4:12 PMoshai
06/22/2020, 9:33 AMnatario1
06/22/2020, 3:28 PMNativeBuildType.DEBUG
which I thought would do the job.
I/Konan_main: Uncaught Kotlin exception:
kotlin.IllegalStateException: Test error!
I/Konan_main: at (0x7e54f3d758) // ???
I/Konan_main: at (0x7e54f37704) // ???
at (0x7e54f37374) // ???
at (0x7e54f37834) // ???
at (0x7e54fba8fc) // ???
at (0x7e54fc7538) // ???
at (0x7e54fb934c) // ???
at (0x7e54f935b8) // ???
at (0x7e54f91420) // ???
at (0x7e54fac57c) // ???
at Java_my_package_my_method (0x7e54ff99b0)
at oatexec (0x7e5541c720)
Arkadii Ivanov
06/22/2020, 9:25 PMisInterrupted
.Jolas
06/23/2020, 6:24 AMAnimesh Sahu
06/23/2020, 12:05 PMJohn O'Reilly
06/23/2020, 2:44 PMUndefined symbols for architecture x86_64:
"_DAAddCallbackToSession", referenced from:
_platform_DiskArbitration_DAAddCallbackToSession_wrapper10 in common(result.o)
(maybe you meant: knifunptr_platform_DiskArbitration10_DAAddCallbackToSession, _platform_DiskArbitration_DAAddCallbackToSession_wrapper10 )
"_DACallbackCreate", referenced from:
_platform_DiskArbitration_DACallbackCreate_wrapper9 in common(result.o)
(maybe you meant: knifunptr_platform_DiskArbitration9_DACallbackCreate, _platform_DiskArbitration_DACallbackCreate_wrapper9 )
"_DAGetCallbackFromSession", referenced from:
_platform_DiskArbitration_DAGetCallbackFromSession_wrapper13 in common(result.o)
(maybe you meant: _platform_DiskArbitration_DAGetCallbackFromSession_wrapper13, knifunptr_platform_DiskArbitration13_DAGetCallbackFromSession )
"_DARemoveCallbackFromSession", referenced from:
_platform_DiskArbitration_DARemoveCallbackFromSession_wrapper12 in common(result.o)
(maybe you meant: knifunptr_platform_DiskArbitration12_DARemoveCallbackFromSession, knifunptr_platform_DiskArbitration11_DARemoveCallbackFromSessionWithKey , _platform_DiskArbitration_DARemoveCallbackFromSessionWithKey_wrapper11 , _platform_DiskArbitration_DARemoveCallbackFromSession_wrapper12 )
"_DARemoveCallbackFromSessionWithKey", referenced from:
_platform_DiskArbitration_DARemoveCallbackFromSessionWithKey_wrapper11 in common(result.o)
(maybe you meant: knifunptr_platform_DiskArbitration11_DARemoveCallbackFromSessionWithKey, _platform_DiskArbitration_DARemoveCallbackFromSessionWithKey_wrapper11 )
"__kernelrpc_mach_port_destroy_trap", referenced from:
_platform_darwin__kernelrpc_mach_port_destroy_trap_wrapper856 in common(result.o)
(maybe you meant: _platform_darwin__kernelrpc_mach_port_destroy_trap_wrapper856, knifunptr_platform_darwin889__kernelrpc_mach_port_destroy_trap )
"_objc_setHook_setAssociatedObject", referenced from:
_platform_objc_objc_setHook_setAssociatedObject_wrapper100 in common(result.o)
(maybe you meant: knifunptr_platform_objc100_objc_setHook_setAssociatedObject, _platform_objc_objc_setHook_setAssociatedObject_wrapper100 )
Mananpoddarm
06/23/2020, 4:31 PMspierce7
06/23/2020, 6:49 PMdazza5000
06/23/2020, 7:06 PM