I am trying to setup Firebase in my android project. I am getting this error:enter image description here
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.
Been looking for fixes online, most of them are removing jcenter() in build.gradle file. I don't have jcenter() or any other repository in my build.gradle.
I have tried to follow manual from Firebase but then things get even more messy. Is there maybe problem with my android studio version? I am using Android Studio Arctic Fox | 2020.3.1 Patch 4. Android gradle plugin version:7.0.4 Gradle version: 7.0.2
Heres my build gradle project:
// 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.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build gradle module (app):
plugins {
id 'com.android.application'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.autentikacija"
minSdk 21
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
}
buildFeatures {
viewBinding true
}
compileSdkVersion 32
buildToolsVersion '30.0.2'
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'com.google.android.gms:play-services-maps:18.0.1'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Any help appreciated.
CodePudding user response:
I had the same problem as you, i searched and i found the steps to follow on the website of Firebase. I hope it works for you as well.
CodePudding user response:
actually you can change the compileSdk to 31, or you can keep it 32 but you need to change the Gradle Wrapper to
distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-bin.zip
that workes with me, I hope it will with you also