Hyun
07/03/2020, 12:18 AMSwiftUI.Image
platform.CoreGraphics.CGImage
is there any way to access them?Mgj
07/03/2020, 8:06 AMTheo
07/04/2020, 8:35 AMzsperske
07/04/2020, 9:04 PMSebastien Leclerc Lavallee
07/05/2020, 4:31 AMld: bitcode bundle could not be generated because '/shared42/build/cocoapods/framework/shared42.framework/shared42(result.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '/shared42/build/cocoapods/framework/shared42.framework/shared42' for architecture arm64
I was using the packForXcode
task way before (with embedding the .framework directly, working fine) but now I moved to cocoapods way and I get this error. How do we enable bitcode ?
Thanks!janvladimirmostert
07/05/2020, 9:24 AMsourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
val coroutinesVersion = "1.3.7-1.4-M2"
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}
> Could not find org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.7-1.4-M2.
Searched in the following locations:
- <https://jcenter.bintray.com/org/jetbrains/kotlinx/kotlinx-coroutines-core-common/1.3.7-1.4-M2/kotlinx-coroutines-core-common-1.3.7-1.4-M2.pom>
- <https://repo.maven.apache.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-common/1.3.7-1.4-M2/kotlinx-coroutines-core-common-1.3.7-1.4-M2.pom>
- <https://dl.bintray.com/kotlin/kotlin-eap/org/jetbrains/kotlinx/kotlinx-coroutines-core-common/1.3.7-1.4-M2/kotlinx-coroutines-core-common-1.3.7-1.4-M2.pom>
- <https://kotlin.bintray.com/kotlinx/org/jetbrains/kotlinx/kotlinx-coroutines-core-common/1.3.7-1.4-M2/kotlinx-coroutines-core-common-1.3.7-1.4-M2.pom>
Required by:
zsperske
07/05/2020, 6:55 PMKotlin.test.Test
annotations and when I try to right click and run from Intellij it generates this test command which looks wrong cleanIosTest iosTest --tests "tests.MyTest.test
, I've tried changing the command to just test --tests "tests.MyTest.test
to no availsaket
07/05/2020, 10:35 PMFriedger
07/06/2020, 1:54 PMsaket
07/06/2020, 5:18 PMsaket
07/06/2020, 8:07 PMMgj
07/07/2020, 10:53 AMbuild.gradle
:
dataBinding {
enabled = true
}
But since i have custom binding adapters i also need kotlin-kapt
plugin. As soon as i add it i get a build error:
C:\x\app\build\generated\source\kapt\release\androidx\databinding\library\baseAdapters\BR.java:3: error: package javax.annotation does not exist
import javax.annotation.Generated;
C:\x\app\build\generated\source\kapt\release\y\databinding\FragmentLoginBindingImpl.java:8: error: package javax.annotation does not exist
@javax.annotation.Generated("Android Data Binding")
Perhaps i need to enable the kotlin-kapt
plugin only for the android target (since it seems to have a dependency on javax.annotation) - How can i do this?Mgj
07/07/2020, 1:44 PMStateFlow
or MutableStateFlow
properties? I've created custom binding adapters before, but i cannot get it to work properly with StateFlowsbod
07/08/2020, 9:10 AMalbertosh
07/08/2020, 3:22 PMexpect class Wrapper<T: Any?>
Working Kotlin for JVM code
actual typealias Wrapper<T> = CompletableFuture<T>
Not working Kotlin for JS code
actual typealias Wrapper<T> = Promise<T>
Compiler claims that
Aliased class should not have type parameters with declaration-site variance
Any clue?Jim
07/08/2020, 4:39 PMSean Najera
07/08/2020, 10:25 PM// MPP - JS & common dependencies
sourceSets["commonMain"].dependencies {
implementation(kotlin("stdlib-common", Versions.KOTLIN))
implementation(Deps.Ktor.COMMON_CORE)
implementation(Deps.Ktor.COMMON_JSON)
implementation(Deps.Coroutines.COMMON)
implementation(Deps.MP_SETTINGS)
implementation(Deps.Ktor.COMMON_SERIALIZER)
implementation(Deps.Serialization.COMMON)
implementation(Deps.Stately.COMMON)
implementation(Deps.Stately.CONCURRENCY)
}
sourceSets["jsMain"].dependencies {
implementation((kotlin("stdlib-js", Versions.KOTLIN)))
implementation(Deps.Ktor.JS_CORE)
implementation(Deps.Ktor.JS_JSON)
implementation(Deps.Coroutines.JS)
implementation(Deps.Ktor.JS_SERIALIZER)
implementation(Deps.Serialization.JS)
}
My goal is to write the repository layer as a library for the three platforms which can use it to request proprietary data, similar to Firebase Realtime database.
But when I import the JS library into the Jetbrains starter React app my javascript binary is 27MiB for dev and 1MiB for prod distributions.
Should I expect ktor & coroutines JS libraries to be that heavy for a JS library? Or am I doing something wrong?Mgj
07/09/2020, 1:18 PMval view: UITextField
view.addTarget(target = view, action = ::onTextChanged, forControlEvents = UIControlEventEditingChanged)
But its not allowed because Required: COpaguePointer? Found: KFunction0
Apparently theres an toCPointer()
function? I cant seem to import it, so im unsure how its to be usedMaurice Jouvet
07/09/2020, 1:51 PM// UseCase
suspend fun run(params: LoginModel): Token = authenticationRepo.auth(params)
It's easy on Android but on iOS I'm struggling.. I used to create a Protocol and a view that is the copy of the android version, but I have to work with event and callbacks.
Is there an "easy way" to do the same android call that on iOS :
@UiThread
fun authenticateAsync(loginModel: LoginModel): Deferred<Token> {
return viewModelScope.async {
authenticationTokenUseCase.run(loginModel)
}
}
chadmorrow
07/09/2020, 8:11 PMandymin
07/09/2020, 8:14 PMsrc
* commonMain
* commonTest
* jvm1Main
* jvm2Main
* jvm2Test
I want it so that running check
or build
would run jvm2Test
and commonTest
so I setup my `build.gradle`:
kotlin {
jvm('jvm1')
jvm('jvm2')
sourceSets {
commonMain { dependencies { ... } }
commonTest {
dependencies {
implementation kotlin('test-annotations-common')
}
}
jvm1Main {
dependsOn commonMain
dependencies { ... }
}
jvm2Main {
dependsOn commonMain
dependencies { ... }
}
jvm2Test {
dependsOn commonTest
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
}
}
However, running ./gradlew build
tries to compile commonTest
through both jvm1Test
and jvm2Test
, and fails since jvm1Test
doesn't have any test dependencies. Is there a way to disable jvm1Test
or decouple it from commonTest
?Kroppeb
07/10/2020, 8:48 AMCannot access built-in declaration '...'. Ensure that you have a dependency on the Kotlin standard library
I'm confused as to why it can't find the stdlib?Rita Curado
07/10/2020, 9:22 AMgradle.properties
in common code?
If not, how can I set an environment variable and read it on common code?
Thanks in advancebod
07/11/2020, 1:16 PMexpect
class and reflecting the constructors of the actual
one. Here's what I'm trying to do:
common:
expect class File(path: String) {
constructor(path: File, name: String)
fun isDirectory(): Boolean
}
jvm:
actual class File actual constructor(path: String): java.io.File(path) {
actual constructor(path: File, name: String)
}
This results in Primary constructor call expected
vashisthg
07/11/2020, 1:42 PMCould not determine the dependencies of task ':[projectname]:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':[projectname]:debugCompileClasspath'.
> Could not resolve project :[shared-library-name].
Required by:
project :[projectname]
Cannot choose between the following variants of project :[shared-library-name]:
- androidApiElements
- androidCompile
- androidCompileOnly
- androidDefault
- androidRuntime
- androidRuntimeElements
- androidTestCompile
- androidTestRuntime
- iosRuntimeOnly
- jvmApiElements
- jvmCompile
- jvmCompileOnly
- jvmDefault
- jvmRuntime
- jvmRuntimeElements
- jvmTestCompile
- jvmTestRuntime
bod
07/11/2020, 6:18 PMimport kotlinx.coroutines.Job
is unknown in my common code, even when I have this dependency: implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$versionsCoroutine")
?Renann
07/11/2020, 11:44 PM.d.ts
files (I don't use the generated javascript code!)
3. Create a typescript script which uses the .d.ts
4. Compile to javascript
5. Run in the GraalVM
The end result I'm looking for like a binding for my kotlin classes to be called from typescript.
I'm using latest kotlin version 1.4-M3.
Disclaimer I'm not expert in typescript (nor kotlin), but
I could do everything, however:
1. The generated typescript definition file doesn't export
module, so I cannot import in my typescript script
2. I added the export keyword to fix it
3. Now I can import the definition and use it, however in order to execute in GraaVM what I need is to import java types from javascript by using the Java.type
call instead of require
Now I would like to know if there's a way to modify the kotlin generator so that I could achieve transpilation from such imported types to javascript and be callable by GraalVM out of the box. Some guidance on this topic would nice and I believe at least the export
of the module should be part of the core kotlin generator.gumil
07/12/2020, 9:26 PMlinkDebugTestIos
i get this error
e: Could not find "atomicfu-cinterop-interop"
I have added this as a dependency to the native source set "org.jetbrains.kotlinx:atomicfu-native:0.14.3"
but it sill has the same error. Can anyone help me figure this out?Jeff
07/13/2020, 7:46 AMI/System.out: [OkHttp] sendRequest>>
The code is as follows:
private val client by lazy {
HttpClient {
install(JsonFeature) {
serializer = KotlinxSerializer(
Json(
JsonConfiguration(
isLenient = true,
ignoreUnknownKeys = true
)
)
)
}
install(Logging) {
logger = Logger.DEFAULT
level = LogLevel.ALL
}
}
}
willyrs
07/13/2020, 10:11 AMiosX64("ios")
iosArm32("iosArm32")
iosArm64("iosArm64")
and I’m trying to have all 3 share the same iosMain folder:
sourceSets["iosArm32Main"].dependsOn(sourceSets["iosMain"])
but it fails with:
A problem occurred configuring project ':shared'.
Collection has more than one element.
willyrs
07/13/2020, 10:11 AMiosX64("ios")
iosArm32("iosArm32")
iosArm64("iosArm64")
and I’m trying to have all 3 share the same iosMain folder:
sourceSets["iosArm32Main"].dependsOn(sourceSets["iosMain"])
but it fails with:
A problem occurred configuring project ':shared'.
Collection has more than one element.
Kris Wong
07/13/2020, 1:39 PMcompilations["main"].defaultSourceSet {
dependsOn(sourceSets["iosMain"])
}
willyrs
07/13/2020, 1:39 PMKris Wong
07/13/2020, 1:40 PMwillyrs
07/13/2020, 1:42 PMkotlin {
iosArm64("iosarm")
iosX64("ios")
}
this shows: A problem occurred configuring project ‘:shared’.
Collection has more than one element.
Kris Wong
07/13/2020, 4:04 PMwillyrs
07/13/2020, 4:06 PMimport org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform")
id("co.touchlab.native.cocoapods")
id("kotlinx-serialization")
id("com.android.library")
}
android {
compileSdkVersion(29)
defaultConfig {
minSdkVersion(Versions.min_sdk)
targetSdkVersion(Versions.target_sdk)
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
}
kotlin {
android()
jvm()
js {
browser {
useCommonJs()
}
}
//iosArm64("iosarm")
iosX64("ios")
targets.getByName<KotlinNativeTarget>("ios").compilations["main"].kotlinOptions.freeCompilerArgs +=
listOf("-Xobjc-generics", "-Xg0")
version = "1.1"
sourceSets {
all {
languageSettings.apply {
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
}
sourceSets["commonMain"].dependencies {
implementation(kotlin("stdlib-common", Versions.kotlin))
implementation(Deps.Ktor.commonCore)
implementation(Deps.Ktor.commonJson)
implementation(Deps.Ktor.commonLogging)
implementation(Deps.Coroutines.common)
implementation(Deps.stately)
implementation(Deps.multiplatformSettings)
implementation(Deps.koinCore)
implementation(Deps.Ktor.commonSerialization)
implementation(Deps.Redux.core)
api(Deps.kermit)
}
sourceSets["commonTest"].dependencies {
implementation(Deps.multiplatformSettingsTest)
implementation(Deps.KotlinTest.common)
implementation(Deps.KotlinTest.annotations)
implementation(Deps.koinTest)
// Karmok is an experimental library which helps with mocking interfaces
implementation(Deps.karmok)
implementation(Deps.Ktor.mock)
}
sourceSets["androidMain"].dependencies {
implementation(kotlin("stdlib", Versions.kotlin))
implementation(Deps.Ktor.jvmCore)
implementation(Deps.Ktor.jvmJson)
implementation(Deps.Ktor.jvmLogging)
implementation(Deps.Coroutines.jdk)
implementation(Deps.Coroutines.android)
implementation(Deps.Ktor.androidSerialization)
implementation(Deps.Ktor.androidCore)
}
sourceSets["jvmMain"].dependencies {
implementation(kotlin("stdlib", Versions.kotlin))
implementation(Deps.kermitJvm)
implementation(Deps.Ktor.jvmCore)
implementation(Deps.Ktor.jvmJson)
implementation(Deps.Ktor.jvmLogging)
implementation(Deps.Coroutines.jdk)
implementation(Deps.Ktor.androidSerialization)
implementation(Deps.Ktor.androidCore)
}
sourceSets["androidTest"].dependencies {
implementation(Deps.KotlinTest.jvm)
implementation(Deps.KotlinTest.junit)
implementation(Deps.AndroidXTest.core)
implementation(Deps.AndroidXTest.junit)
implementation(Deps.AndroidXTest.runner)
implementation(Deps.AndroidXTest.rules)
implementation(Deps.Coroutines.test)
implementation(Deps.Ktor.jvmMock)
implementation(Deps.RoboEletric.droid)
}
sourceSets["iosMain"].dependencies {
implementation(Deps.Ktor.ios)
implementation(Deps.Ktor.iosCore)
implementation(Deps.Ktor.iosJson)
implementation(Deps.Ktor.iosLogging)
implementation(Deps.Coroutines.native) {
version {
strictly("1.3.5-native-mt")
}
}
implementation(Deps.Ktor.iosSerialization)
implementation(Deps.koinCore)
}
sourceSets["jsMain"].dependencies {
implementation(Deps.Ktor.js)
implementation(Deps.Ktor.jsCore)
implementation(Deps.Ktor.jsJson)
implementation(Deps.Ktor.jsLogging)
implementation(Deps.Ktor.jsSerialization)
implementation(Deps.Coroutines.js)
implementation(Deps.koinCoreJS)
api(npm("text-encoding"))
api(npm("bufferutil"))
api(npm("utf-8-validate"))
api(npm("abort-controller"))
api(npm("fs"))
implementation(npm("styled-components"))
implementation(npm("inline-style-prefixer"))
implementation(npm("react-router-dom", "5.1.2"))
implementation(kotlin("stdlib-js"))
implementation(npm("react", "16.13.0"))
implementation(npm("react-is", "16.13.0"))
implementation(npm("react-dom", "16.13.0"))
// version 94 is the last one that works (108 and 109 are bugged)
implementation("org.jetbrains:kotlin-react:16.13.0-pre.94-kotlin-1.3.70")
implementation("org.jetbrains:kotlin-react-dom:16.13.0-pre.94-kotlin-1.3.70")
implementation("org.jetbrains:kotlin-styled:1.0.0-pre.94-kotlin-1.3.70")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.5")
// implementation("org.jetbrains:kotlin-react-router-dom:5.1.2-pre.107-kotlin-1.3.72")
}
task("fullBuild") {
dependsOn("build")
doLast {
exec {
commandLine = "rm -rf ios/shared.framework".split(" ")
}
exec {
commandLine = "mv -f build/bin/ios/releaseFramework/shared.framework ../ios/shared.framework".split(" ")
}
}
}
}