Unable to build multi subprojects structure

Hello,

So I’m trying to create a project by following this structure given below

MainApplication
│
├── android-app
│   │
│   ├── app
│   │   └── build.gradle.kts
│   │ 
│   └── settings.gradle.kts
│
├── build-system
│   │
│   ├── kotlin-library
│   │   └── build.gradle.kts
│   │  
│   ├── android-library
│   │   └── build.gradle.kts
│   │ 
│   └── settings.gradle.kts
│ 
├── platform
│   │
│   ├── plugin-platform
│   │   └── build.gradle.kts
│   │
│   └──settings.gradle.kts
│
├── gradle
│   └── wrapper
│       └──gradle-wrapper.properties
│
└── settings.gradle.kts

I’m using Gradle 7.0.2 for this project.

Now when I’m trying to sync my project I’m getting the following error

java.lang.IllegalArgumentException: Failed requirement.
	at org.gradle.kotlin.dsl.tooling.builders.KotlinBuildScriptModelBuilderKt.getPrecompiledScriptPluginsMetadataDir(KotlinBuildScriptModelBuilder.kt:230)
	at org.gradle.kotlin.dsl.tooling.builders.KotlinBuildScriptModelBuilderKt.access$getPrecompiledScriptPluginsMetadataDir$p(KotlinBuildScriptModelBuilder.kt:1)

If I’m trying to run assembleDebug on the app I’m seeing that the build-system is using Gradle 6.8 instead of 7.0.2. I tried to debug why it is getting 6.8 but failed.

Caused by: java.lang.RuntimeException: Minimum supported Gradle version is 7.0.2. Current version is 6.8. If using the gradle wrapper, try editing the distributionUrl

Check that the version numbers in your Gradle files are in sync with the settings in File -> Project structure -> Project, especially the version used in the distributionUrl in gradle-wrapper.properties.