Description
The Android build fails due to the use of the deprecated and removed jcenter() repository inside the library’s Gradle file.
Error
A problem occurred evaluating project ':react-native-cookies_cookies'.
> Could not find method jcenter() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
Full stack trace excerpt:
Build file '.../node_modules/@react-native-cookies/cookies/android/build.gradle' line: 70
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException:
Could not find method jcenter() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.
Environment
- React Native project
- Failing on Android build
- Gradle version: 9.x (jcenter removed)
- Library: @react-native-cookies/cookies
Where the issue occurs
Inside:
node_modules/@react-native-cookies/cookies/android/build.gradle
Expected Behavior
Library should use modern repositories (mavenCentral(), google()) instead of jcenter(), which has been removed and is no longer supported in Gradle 9+.
Actual Behavior
Build fails during project evaluation.