https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
f

Fail

09/20/2019, 3:13 PM
Hi All! How to use kapt in multiplatform? I apply kap plugin and use kapt 'com.github.bumptech.glidecompiler4.9.0' in androidMain section. but have an error Gradle DSL method not found: 'kapt()'
k

Kris Wong

09/20/2019, 3:17 PM
have you applied the kotlin android extensions plugin?
f

Fail

09/20/2019, 3:19 PM
Yes apply plugin: 'kotlin-android-extensions'
j

Jonas Bark

09/20/2019, 4:16 PM
Kapt isn't supported, but there's https://github.com/Foso/MpApt
f

Fail

09/20/2019, 4:17 PM
Can I use kapt only for android in multiplatform?
How to use Realm, dagger Glide without kapt?
e

Erik Christensen

09/20/2019, 4:30 PM
You can't use kapt within a multiplatform library, but you can probably create a separate Android-only library that the androidMain target of your multiplatform library includes as a dependency. Make sense?
r

russhwolf

09/20/2019, 4:42 PM
Some notes on multiplatform kapt for Android at https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#android-support. You need to put kapt dependencies in the top-level dependencies block instead of the sourceSet dependencies. I haven't played with it much though.
But also I agree splitting a lot of that into a separate module often makes sense
f

Fail

09/23/2019, 6:50 AM
I put into top level but have error too 😞
Oh. Thank you guys! Really. My dependency was be over
Copy code
kotlin {}
block. After moving under it working
4 Views