Closed MitsuraIvan closed 5 years ago
@MitsuraIvan any solution found? I'm having the same issue :(
@4face-studi0 no from my side, sadly. You can try kotlin/native channel at slack, this thread got ignored, seems like it will not be possible with new project structure that using combined gradle for all platforms
@MitsuraIvan @4face-studi0
Kapt should work in multiplatform projects where an Android target is declared. First, note that kapt
dependencies should be added after the Android target is declared in the kotlin { ... }
block. You can move those dependency declarations below the kotlin { ... }
block.
You don't need to apply the kotlin-android
plugin in a project where kotlin-mulatiplatform
is applied, the Android target that is declared in the kotlin { ... }
scope should be enough.
If you face any further issues once you fix the kapt
dependency declaration, feel free to comment here so I can look into it.
Hi, at intellij generated project there is 1 build.gradle file for all platforms and because of
kotlin-multiplatform
plugin we cant use pluginkotlin-android
and because of thatkotlin-kapt
plugin dont do anything. with kotlin-android plugin we got errorCannot add extension with name 'kotlin', as there is an extension already registered with that name.
without kotlin-android plugin we got errorCould not find method kapt() for arguments [android.arch.persistence.room:compiler:1.1.1] on object of type org.jetbrains.kotlin.gradle.plugin.mpp.DefaultKotlinDependencyHandler.
it makes dagger/room and other stuff on android impossible to use which kinda kills the point of development. Any suggestions? is this a bug or bad gradle file?project level build.gradle
app build.gradle