Hi Everyone - I'm trying to create a KMP project f...
# multiplatform
a
Hi Everyone - I'm trying to create a KMP project for use on both Windows and Mac. I have found that if I create one on Mac, that it can then be read on Windows - but not the other way round - I get gradle errors when opening on Mac (from project copied from windows) - invalidating cache + deleting folder didn't help. Note that this is just with the standard initial KMP application project. A different issue is that the Mac project is ~3GB for a basic application so this is not very 'portable'. However, I hope to be teaching this and telling student teams to either create first on Mac or get stuck on windows is not great 😉 Does anyone have experience of a good approach to creating a starting project for sharing (a small codebase) between windows and mac? Preferably that fits with Git usage across a team of student developers - who are very inventive at finding new ways of breaking things... Here are the options I have so far - 1. Create on Mac. Try to strip to just the code and then share - this scares me since it's likely to just consume time... 2. Try and Fix the windows gradle - so far I have failed miserably at this. 3. Use an existing Git KMP example project - but the targets seem to be quite restrictive as well as project specific...also this option seems to be likely to be out of date due to the (Mac only 😞 ) plugin. Thank you in advance - Andy
c
Hey, welcome to this Slack! You mention that you've had errors;
I get gradle errors when opening on Mac
If you don't tell us which ones, we can't help you!
âž• 1
a
I got this to work - so I created on Windows, copied zip to mac and it works - the problem I had was using a Dropbox folder?! I also renamed the project name to not include spaces - and made sure the folder didn't include spaces - but I don't think those changes had any effect. So - don't Dropbox share your android studio project between Windows and Mac...
✅ 1
c
Ouch 😅 You should probably look into using GitHub or GitLab to ensure the files aren't modified in transit 😕
e
(lack of) file execute permissions may be the problem. that's not something that Windows supports, not Dropbox, but the Gradle scripts on macos and Linux do need them. I'd expect creating a project on macos and then transferring it to another macos machine to also fail.
I would also suggest using Git or any other real version control system. Dropbox doesn't work for code development
also it should not be ~3GB. you are likely including a lot of download and transform caches with that
a
I do use Git as well - Dropbox allows me to access my working code from home, office or laptop, any time, without having had to commit. I use Dropbox happily this way with VSCode and also with Android Studio when just PC based - but not with Mac. But really this is a warning for others... Now I know Mac can work - I will work out a smaller repository...