React-native native android module. Facing several errors with this https://developer.tomtom.com/android/maps/documentation/overview/project-set-up . Trying to build a native android module for React native project. Can anyone tell me where to add this piece of code

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://repositories.tomtom.com/artifactory/maven")
        }
    }
}

in which file?build.gradle of app?build.gradle of project?settings.gradle?
wherever I add it is showing this following error...

Could not find method dependencyResolutionManagement() for arguments [build_2lvry1fw81l4zm1hlike242ly$_run_closure2@35c8b4b1] on root project 'CheckFragNativeComp' of type org.gradle.api.Project.

Can someone help resolving this error? Tried the following

  1. Created new RN project and tried to modify android folder
  2. created seperate android project and tried to integrate existing app to RN
1

There are 1 best solutions below

1
On

You will need to place this code snippet in settings.gradle as instructed here.