Hi All, There is a problem I have been facing for ...
# multiplatform
a
Hi All, There is a problem I have been facing for a few days while migrating my old KMP project to the latest compose,kotlin and agp plugins. Help is much appreciated. Below is the error that i am facing which is saying that it is not able to find the manifest file inside Android main
this android build.gradle file
libs.version.toml
this is shared build.gradle file
p
I think it is missing this closure
Copy code
sourceSets {
        named("main") {
            manifest.srcFile("src/androidMain/AndroidManifest.xml")
            res.srcDirs("src/androidMain/res", "src/commonMain/resources")
        }
    }
a
@Pablichjenkov No it is not the issue. I tried but no luck.
p
Ahh 😫 so unfortunate. 🤔 No idea what could be wrong.
e
well did you move your manifest file from main to androidMain? that is something that changed, see https://kotlinlang.org/docs/multiplatform-android-layout.html
👆 1
b
Hey @Anshulupadhyay03 ! Instead of using
androidApplication
inside the shared file, use
androidLibrary
💡 1
a
@Behzod no this even not making app grandle sync
@ephemient Yes, I checked that but I don't think I have to move the manifest file into androidMain as i have tried that also but it is not able to access MainActivityclass and other resources of the android app.
i have pushed the code into new branch if anyone wants to try on his machine https://github.com/youranshul/KmmMovieBuff/tree/add_web_support
p
I was able to run it, basically combining all above answers. You need to change a couple of things. Java1.8 to Java17, targetSdk from 33 to 34, in shared module apply androidLib plugin instead of androidApp plugin, place at least an empty manifest in shared(I think this one is optional). I also apply the multiplatfom plugin in androidApp and rename
main
to
androidMain
a
@Pablichjenkov Oh Great. Thanks, i will give it a try as well.
👍 1