https://kotlinlang.org
Join Slack
Anyone knows how to create gradle JavaExec configuration for multiplatform project? ```tasks.create&...
t

Tomasz Krakowiak

almost 4 years ago
Anyone knows how to create gradle JavaExec configuration for multiplatform project?
tasks.create<JavaExec>("run") {
    classpath = //?
    mainClass.set("com.example.MainKt")
}
sourceSets
container is at this point empty.
configurations
container does not have
jvmMainRuntime
configuration.
t
h
e
  • 3
  • 3
  • 1270
How can you fill a row with two buttons: First button should take the max width, but there should be...
h

hfhbd

over 3 years ago
How can you fill a row with two buttons: First button should take the max width, but there should be another minified button.
@Composable
fun InfoButton(infoTest: String, button: @Composable (Modifier) -> Unit) {
    Row(modifier = Modifier.fillMaxWidth()) {
        Info(infoTest)
        button(Modifier.fillMaxWidth())
    }
}
This code renders the icon at the left side, I want to show them on the right side
h
p
c
  • 3
  • 9
  • 1268
Hi everyone, what is the difference channel `receiveAsFlow` vs `consumeAsFlow`? `receiveAsFlow` can...
r

Ruben Quadros

over 3 years ago
Hi everyone, what is the difference channel
receiveAsFlow
vs
consumeAsFlow
?
receiveAsFlow
can have multiple collectors and
consumeAsFlow
only 1?
r
s
  • 2
  • 1
  • 1264
Hey there! Is there any way to get the file name in a Kotlin file? This functionality could be helpf...
m

Marc Reichelt

over 3 years ago
Hey there! Is there any way to get the file name in a Kotlin file? This functionality could be helpful with e.g. logging, where the other approaches have drawbacks: • need to manually define tag (manual, can be messed up when filename changes) • or: throw a full
Throwable()
, to only get the file / class name (performance issues) • or: using
reified
to get the class name (will print weird log tags when scope changes (e.g. it will print
CoroutineScope
in some instances))
m
e
+5
  • 7
  • 18
  • 1264
Hi, I am using Kotlin Multiplatform to build iOS/Android App. Recently I just updated to Gradle 8.0....
j

Jan

over 2 years ago
Hi, I am using Kotlin Multiplatform to build iOS/Android App. Recently I just updated to Gradle 8.0.0 due update of AndroidStudio from Electric Eel to Flamingo. Starting the iOS Project from AndroidStudio is working fine. Right now I do have a problem to run my iOS Project from Xcode (14.3). Building the ios framework fails with: "Android Gradle plugin requires Java 17 to run. You are currently using Java 11. ... Your current JDK is located in /Library/Java/JavaVirtualMachines/amazon-corretto-11.jdk/Contents/Home". I do not understand why XCode has a different JDK. In my .zshr file its defined like: export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home and if I check ./gradlew -v it says: Gradle 8.0 ------------------------------------------------------------ Build time: 2023-02-13 131521 UTC Revision: 62ab9b7c7f884426cf79fbedcf07658b2dbe9e97 Kotlin: 1.8.10 Groovy: 3.0.13 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.6 (JetBrains s.r.o. 17.0.6+0-17.0.6b802.4-9586694) OS: Mac OS X 13.0.1 aarch64 Why is gradle using a differnt JDK while running from xCode?
j
l
  • 2
  • 15
  • 1263
what's the right way to change the TopAppBar title (or any other prop for that matter) dynamically f...
o

oday

almost 2 years ago
what's the right way to change the TopAppBar title (or any other prop for that matter) dynamically from each screen? So right now I have 1 Scaffold which use and inside is the NavHost, passed to each
composable
inside is
scaffoldState
where I go
scaffoldstate.value.title = { Text("Screen A" }
and the primary Scaffold just populates its own topAppBar with MyAppBar(title = scaffoldState.title) but this causes a lot of jank when switching between bottom bar destinations and sometimes one screen ends up with the title of the other and it's just bad having 2 Scaffolds causes a visual effect where you can see them being swapped out, Now In Android does it really well but the code is so convoluted I couldn't really pin down even where the switch was happening
o
y
f
  • 3
  • 16
  • 1261
I'm getting the following error when trying to build an app with ktor ```No matching toolchains foun...
r

Rodrigo Silva

over 2 years ago
I'm getting the following error when trying to build an app with ktor
No matching toolchains found for requested specification: {languageVersion=11, vendor=any, implementation=vendor-specific}.
gradle 8.0.2, openjdk 17
r
a
  • 2
  • 2
  • 1261
Hello guys, i triyng use androidx.compose.material:material-icons-extended:1.6.1 on compose multipl...
g

Guilherme Germano Silva

over 1 year ago
Hello guys, i triyng use androidx.compose.materialmaterial icons extended1.6.1 on compose multiplataform, but i facing this error
:composeApp:iosArm64Main: Could not resolve androidx.compose.material:material-icons-extended:1.6.1.
Someon can help me please?
g
j
s
  • 3
  • 10
  • 1261
Hi all, can we use firebase analytic on a KMM project?
b

brabo-hi

over 3 years ago
Hi all, can we use firebase analytic on a KMM project?
b
m
k
  • 3
  • 12
  • 1259
I am having a problem building a KMM project in Android Studio with the following message " Cannot l...
o

Owen

over 1 year ago
I am having a problem building a KMM project in Android Studio with the following message " Cannot locate tasks that match 'sharedtestClasses' as task 'testClasses' not found in project ':shared'."
➕ 7
o
s
+7
  • 9
  • 15
  • 1255
Previous272829Next

kotlinlang

A modern programming language that makes developers happier.

Powered by