I am trying to learn to create android application with android studio
the app is blank there is no pages yet unless the main Activity
i did project on firebase and put the name (com.example.connect)
and i add the jason file to the App location and i did everything
but still when i click connect this error keep pop to me
(Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync)
when ever i watch a video to solve this problem can fix mine! What i can do?
Build gradle APP
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "RUVOLT"
include ':app'
build gradle Module
plugins {
id 'com.android.application'
id 'com.google.firebase.crashlytics'
}
android {
compileSdk 32
defaultConfig {
applicationId "com.example.ruvolt"
minSdk 19
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
}
}
apply plugin: 'com.google.gms.google-services'
dependencies {
implementation 'com.google.firebase:firebase-analytics:20.0.2'
implementation platform('com.google.firebase:firebase-bom:29.0.3')
implementation 'com.google.firebase:firebase-analytics'
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.firebase:firebase-crashlytics:18.2.6'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
CodePudding user response:
Add google service plugin
plugins { id 'com.android.application' id 'com.google.gms.google-services' id 'com.onesignal.androidsdk.onesignal-gradle-plugin'}
and also check build gradle project for google service dependency
classpath 'com.google.gms:google-services:4.3.10'
CodePudding user response:
In Your build.gradle apply these plugins and libraries for adding firebase.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
implementation platform('com.google.firebase:firebase-bom:26.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
In your class path file please verify that you entered these lines properly inside dependecies tag;
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
And Yes obviously make sure you have added JSON file of google under the app section of the Project file.
