Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't set up a KMM project in android studio for the first time

I've never worked with KMM (Kotlin Multiplatform Mobile) before. I just updated to the latest version of kotlin and installed KMM Plugin in android studio then restarted android studio(Using this link). Then I created a new project(using this link) but it gave me this error. I don't know what to do, I've tried clearing cache and restart and also tried creating another project but it still gives the same error. I've built android apps in my android studio before with java and kotlin and it works perfectly. So maybe this is an error of KMM or such? The Error I am getting

like image 518
Sharif Rafid Ur Rahman Avatar asked Sep 19 '25 14:09

Sharif Rafid Ur Rahman


2 Answers

Change the offending string like this:

"src\androidMain\AndroidManifest.xml" to "src\\androidMain\\AndroidManifest.xml"

i.e. add another \ with each \ in the path.

This threw me off as well, since one expects a new project skeleton to just work.

Hope this sorts it out for you, this worked for me.

like image 68
D Prinsloo Avatar answered Sep 21 '25 15:09

D Prinsloo


Yes, you are getting this error, because there is only one slash before a and A in your shared build.gradle.kts file as shown in attached screenshot. enter image description here

so, to solve this you need to add one more slash before both as per the attached below screenshot:

enter image description here

that's it!

like image 38
Hemant N. Karmur Avatar answered Sep 21 '25 15:09

Hemant N. Karmur