'How to solve " A problem occurred configuring project ':firebase_auth'. "

I'm working with firebase in flutter and on running my app i get the following logs

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':firebase_auth'.
> Could not resolve all artifacts for configuration 
':firebase_auth:classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib- 
jdk8:1.3.50.
 Required by:
     project :firebase_auth > 
com.android.tools.build:gradle:3.5.4
     project :firebase_auth > 
com.android.tools.build:gradle:3.5.4 > 
com.android.tools.build:builder:3.5.4
     project :firebase_auth > 
com.android.tools.build:gradle:3.5.4 > 
 com.android.tools.lint:lint-gradle-api:26.5.4
     project :firebase_auth > 
com.android.tools.build:gradle:3.5.4 > 
com.android.tools.build:gradle-api:3.5.4
     project :firebase_auth > 
com.android.tools.build:gradle:3.5.4 > 
androidx.databinding:databinding-compiler-common:3.5.4

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  firebase_auth: ^3.0.1
  firebase_core: ^1.4.0

Can someone help please



Solution 1:[1]

i do this for stable work: in android/gradle/wrapper/gradle-wrapper.properties change line to ->

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip

in android/app/build.gradle

    defaultConfig { 
        minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
        targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()

in android/build.gradle

    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.2'

add This in android/local.properties

flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
flutter.minSdkVersion=21
flutter.targetSdkVersion=30
flutter.compileSdkVersion=30

open the Android folder separate with ur IDE, then he will download the new Gradle version automatically

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1