Firebase is not connecting and its show an error like Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.
some people say to remove the jcenter()..But in my app gradle i didnt see any all projects repository This is my application built.gradle...
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}`
Gradle declares dependencies on JAR files inside your project's module_name /libs/ directory (because Gradle reads paths relative to the build.gradle file). This declares a dependency on version 12.3 of the "app-magic" library, inside the "com.example.android" namespace group.
You can find the list of all local git repositories by navigating from “ Git > Local Repositories .” Based on the previously configured folder for the local repos, Visual Studio will change the context for the local repositories.
The repositories closure that you have in allprojects closure says "these are the artifact repositories from which to pull your own application dependencies ".
Then, you will have all the local repos on your fingertip. You can select the repos to open them up in Visual Studio instantly. Chancing the context for the the local repositories can be done from separate place.
The repositories closure in there serves the same basic role as the repositories closure in allprojects in the old system. So, add PayPal's maven {} content inside of the repositories closure in settings.gradle. Check in the Setting Gradle file. this file adds the new functionality to add the dependency resource
I had the same problem while adding "maven { url 'https://jitpack.io' }"
I solved the issue by adding it to settings.gradle file as below,
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url 'https://jitpack.io' }
}
}
I had the same problem when trying to add a repository for "maven { url 'https://jitpack.io' }" with gradle 7.0.2.
When I add the allprojects block: -
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
I get the following error.
A problem occurred evaluating root project 'PetShop List'.
Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'
The reason is due to the dependencyResolutionManagement block in settings.gradle.
To resolve it, simply go to "settings.gradle" file comment off the whole block for 'dependencyResolutionManagement'.
Then reSync your project and it should work.
change like this in settings.gradle
import org.gradle.api.initialization.resolve.RepositoriesMode
dependencyResolutionManagement {
repositories {
google()
// notice here -------------------------
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
// notice here -------------------------
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
}
}
rootProject.name = "My Application"
include ':app'
Go to setting.gradle
file. Then add maven { url 'https://jitpack.io' }
this line.
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url 'https://jitpack.io' }
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With