I have been trying to solve this problem for a few hours with different alternatives that I find in Google and nothing, I do not solve the problem.
build.gradle
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
}
android {
compileSdk 32
viewBinding {
enabled = true
}
defaultConfig {
applicationId "pe.idat.proyectofinal"
minSdk 25
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-firestore-ktx:24.3.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation platform('com.google.firebase:firebase-bom:30.4.1')
//retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
//gson
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// picasso
implementation 'com.squareup.picasso:picasso:2.71828'
}
another..
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.14'
}
}
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}
allprojects {
repositories {
// Make sure that you have the following two repositories
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
//dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
// repositories {
// google()
// mavenCentral()
// maven { url 'https://jitpack.io' }
// }
//}
rootProject.name = "Foods"
include ':app'
I commented that because I was getting this error:
A problem occurred evaluating root project 'Foods'. Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'
When I comment it out my application runs correctly but when I try to insert something in Firestore, this appears in the console, but the application continues to run.
W/Firestore: (24.3.1) [WriteStream]: (f440a7b) Stream closed with status: Status{code=UNAVAILABLE, description=Channel shutdownNow invoked, cause=null}. W/DynamiteModule: Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found. I/DynamiteModule: Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0 W/ProviderInstaller: Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0. W/ProviderInstaller: Failed to report request stats: com.google.android.gms.common.security.ProviderInstallerImpl.reportRequestStats [class android.content.Context, long, long]
I was searching in google and I understood that it could be due to this (I did not have it installed) but the problem continues
