https://kotlinlang.org
Join Slack
How do I create a zip file in memory only, using files from a relative directory?
m

martmists

over 7 years ago
How do I create a zip file in memory only, using files from a relative directory?
m
g
  • 2
  • 1
  • 1466
Hello I am trying to use `"org.jetbrains.compose.components:components-resources:1.3.1-rc01"` to loa...
f

Francis Mariano

over 2 years ago
Hello I am trying to use
"org.jetbrains.compose.components:components-resources:1.3.1-rc01"
to load images images via compose in common module, but the images are not loaded. More info in the thread.
f
j
  • 2
  • 14
  • 1460
I’m trying to use HILT to inject an implementation of a repository class into the UseCase class (the...
l

lpirro

almost 3 years ago
I’m trying to use HILT to inject an implementation of a repository class into the UseCase class (the interface lives in the
domain
module, and the implementation in the
repository
module with the
repository
module depending on the
domain
one) but receiving an error when building the app: DomainModule.kt - lives into
:domain
module
@Module
@InstallIn(SingletonComponent::class)
 object DomainModule {

    @Provides
    fun provideGetUpcomingLaunchesUseCase(repository: SpaceHubRepository): GetUpcomingLaunchesUseCase {
        return GetUpcomingLaunchesUseCaseImpl(repository)
    }

}
SpaceHubRepository.kt - lives into:
:domain
module
interface SpaceHubRepository {
    suspend fun getUpcomingLaunches(): Flow<List<Launch>>
}
RepositoryModule.kt - lives into
:repository
module
@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {

    @Provides
    fun provideRepository(
        apiService: SpaceHubApiService,
        launchMapper: LaunchMapper
    ): SpaceHubRepository {
        return SpaceHubRepositoryImpl(apiService, launchMapper)
    }

    @Provides
    fun provideLaunchMapper(): LaunchMapper = LaunchMapperImpl()
}
😶 3
🧵 1
l
c
y
  • 3
  • 6
  • 1460
What’s the best way to get the “current scope” for a suspend function? In other words, `suspend fun ...
s

sam

about 6 years ago
What’s the best way to get the “current scope” for a suspend function? In other words,
suspend fun foo() { async { ... } }
. I’d like to use async inside foo, and inherit from whatever scope foo was called with.
s
w
o
  • 3
  • 26
  • 1458
I am trying to setup KSP in the Multiplatform project (for Android and iOS). I've let the Android St...
p

Pavel Lahoda

over 2 years ago
I am trying to setup KSP in the Multiplatform project (for Android and iOS). I've let the Android Studio to create a default multiplatform project, then added new module ksp with my ksp processor (taking it straight from another project, where it worked as expected). I have the META-INF.services SymbolProcessorProvider file defined. However, when I add following into the gradle file of my shared module :
add("kspAndroid", project(":ksp"))
I am getting an error:
Task :shared:kspDebugKotlinAndroid FAILED
e: [ksp] No providers found in processor classpath.
Not sure where the info about "debugKotlinAndroid" is comming from, there is no such target nor module in the project. When I replace the dependencies with:
add("kspIosX64", project(":ksp"))
The project make works, but the ksp processor is not invoked. I would try to put the dependencies into the individual modules for both platforms, but this is not possible as there is no gradle file on the iOS platform. Anybody has a success with setting up KSP with Android and iOS multiplatform project? Any idea what I might be doing wrong?
p
j
  • 2
  • 2
  • 1454
Compose for Web on Canvas/Skia/Wasm: I have a simple function `BrowserViewportWindow` for the initia...
o

Oliver.O

over 3 years ago
Compose for Web on Canvas/Skia/Wasm: I have a simple function
BrowserViewportWindow
for the initial window. It is easy to use, supports resizing, fills the entire browser viewport, sets the window title correctly and does not require a stylesheet. Inspired by code in @Tlaster's PreCompose. If you want to try: Code in 🧵
👏🏾 1
👏 11
o
d
+12
  • 14
  • 59
  • 1453
I’m getting this after enabling K2 mode &gt; Plugin ‘Kotlin Multiplatform’ wasn’t loaded because it’...
a

aidanvii

over 1 year ago
I’m getting this after enabling K2 mode
Plugin ‘Kotlin Multiplatform’ wasn’t loaded because it’s incompatible with the Kotlin plugin in K2 mode
a
t
+2
  • 4
  • 8
  • 1448
Is there a way to show a Compose popup or dialog from an Android custom view? We have lots of Androi...
e

Eric Martori

over 3 years ago
Is there a way to show a Compose popup or dialog from an Android custom view? We have lots of Android custom views that we don't have the time to migrate fully to compose, but we are adding new developments in compose gradually. Adding
ComposeView
in the XML works for most cases, but now we have to show a pop window and an alert on user interaction. We have tried creating the
PopupWindow
and
AlertDialog
programmatically and setting the content view as a
ComposeView
with the desired content but we get errors like:
java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from android.widget.PopupWindow$PopupDecorView
So we are thinking that maybe there is a way to launch the alert and popup directly from compose, but don't know how to launch it from inside a custom view without replacing the already working content.
e
m
a
  • 3
  • 18
  • 1447
I upgraded the Kotest version from &lt;kotest.version&gt;4.6.4&lt;/kotest.version&gt; to &lt;kotest....
r

Rajkumar Singh

almost 4 years ago
I upgraded the Kotest version from <kotest.version>4.6.4</kotest.version> to <kotest.version>5.1.0</kotest.version> in my maven pom. and now I'm getting the following error. this is a spring boot project with 100% Kotlin.
r
t
  • 2
  • 14
  • 1444
How do I cast a json field to a string in exposed DSL (using postgres db)?
d

dave08

about 4 years ago
How do I cast a json field to a string in exposed DSL (using postgres db)?
d
b
t
  • 3
  • 11
  • 1441
Previous202122Next

kotlinlang

A modern programming language that makes developers happier.

Powered by