I'm configuring an existing Android app adding react native support. I already migrated gradle files in the documentation to Kotlin DSL and Versions catalog which is the target configuration required by the existing app.
The current configuration in settings.gradle.kts
requires settings repositories:
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() //... }}
Right after applying the plugin in :app build.gradle.kts
like this:
plugins { //.. id("com.facebook.react")}
I get the following error:
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin 'com.facebook.react'
Switching to repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
makes the error only a warning but then I get other errors when compiling probably because of the conflict and ultimately I need to stick to RepositoriesMode.FAIL_ON_PROJECT_REPOS
to comply with the policies.
Here is the error I get when I use RepositoriesMode.PREFER_SETTINGS
:
A problem occurred configuring project ':app'.> defaultConfig contains custom resource values, but the feature is disabled.
Here is the list of warnings I get:
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'MavenRepo' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'maven2' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by plugin 'com.facebook.react'Build was configured to prefer settings repositories over project repositories but repository 'maven3' was added by plugin 'com.facebook.react'
I'm currently using com.facebook.react:react-android:0.73.4
Any ideas?