'Could not find method apply() for arguments [7.1.1] on project ':app' of type org.gradle.api.Project

when i import a project from github to my android studio i have this problem ( problem with gradle ) i need a method how to use old project from github without use internet and download gradle every time

Error like this

build.gradle

apply '7.1.1'
android {
compileSdkVersion 32
buildToolsVersion "28.0.3"

defaultConfig {
    applicationId "course.labs.fragmentslab"
    minSdkVersion 14
    targetSdkVersion 32
}

buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}

}

gradle-wrapper.proprties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source