'gradle could not find method repositories() for arguments

I have facing the gradle issues on my existing project after updating the gradle on latest version

When I file> sync project with gradle files and after that they show me this error

Could not find method repository() for arguments [{url=file://D:\Projects\Global_Solutions\Mversion\ReactNativeMultiVendor\ReactNativeMultiVendor\node_modules\react-native-appearance\android/../android/maven}] on object of type org.gradle.api.internal.artifacts.repositories.DefaultMavenArtifactRepository

I check the file location and the maven directory wasn't found in my project files on the location THere is code where mention the error

    task installArchives(type: Upload) {
        configuration = configurations.archives
        repositories.maven {
            // Deploy to react-native-event-bridge/maven, ready to publish to npm
            repository url: "file://${projectDir}/../android/maven"
            configureReactNativePom pom
        }
    }
}


Sources

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

Source: Stack Overflow

Solution Source