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

spierce7

03/26/2020, 4:45 AM
The
multiplatform
plugin seems to get confused by Android flavor source sets with expect / actual. i.e. I have an expected declaration inside of
src/commonMain
, and then for Android I have actual declarations inside of
src/internal
and
src/production
(the folders for Android Flavors). I’m seeing the following error:
Copy code
Actual object <class name> has no corresponding `expected` declaration.
Copy code
Redeclaration <class name>
Does anyone know of a solution? The error is only in the IDE. The app compiles fine.
g

Gunslingor

03/26/2020, 5:31 AM
I thought I remember reading something about that, that you had to do something special for android but I don't recall unforumately and I could be mistaken. I did get that error a few times today, I think it was usually package names being wrong after moving files around. Did you set the kotlin.srcDir correctly for each sourceset? since it sounds like you have two separate source dirs for the same android distro perhaps you have to add two of them, I think you can. Just theories of a novice multplatform dev
I've been getting these warnings lately which are similar and annoying.. this stuff really is tough to string together but I can tell its powerful if you can get it working right... I'm on week three, maybe 40% to where I need this gradle script to be. i.e. if it doesn't depend on them then why are my front end tests literally dependent on them like the examples, lol.
6 Views