I am making a project where I am using firebase authentication. I made my login activity but when I ran it, it said that the application won't run until Google Play services are not updated.
Following are some changes that I made to my app:gradle file.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.devanshisukhija.sicsrattendance"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:mediarouter-v7:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.google.gms:google-services:3.2.0'
//implementation 'com.google.android.gms:play-services-base:11.4.2'
implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: "com.google.gms.google-services"
But I am still getting the following error:
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.
remove this
apply plugin: 'com.google.gms.google-services'
because you already have provided
apply plugin: "com.google.gms.google-services"
so there is no need of applying gms.google.services plugin.
and also add
classpath 'com.google.gms:google-services:3.0.0'
in project level build file.
Hope this will help you.
delete the line in build gradle
apply plugin: 'com.google.gms.google-services'
"com.android.application" package already has 'com.google.gms.google-services' package.
Related
I am trying to run an old project on Android Studio, it used to work fine but now trying to run again without making any changes. I have tried many things but had no success and getting this error. Any help will be appreciated
A problem occurred configuring project ':app'.
I've updated the Gradle version but not sure where it's failing now.
Here is the gravel file.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.name"
minSdkVersion 30
targetSdkVersion 30
versionCode 3
versionName "3.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
// implementation 'com.google.android.gms:play-services-ads:12.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
//implementation 'org.jetbrains.anko:anko-sdk15:0.8.2'
//implementation 'com.beust:klaxon:0.30'
}
apply plugin: 'com.google.gms.google-services'
If this project can run normally in the past, generally only need File -> Invalidate Caches
I'm reading a documents regarding the new glide on how to install on my app, Its quite difficult now since they update the new api and document unlike before and following there instruction, but why I'm getting this error:
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
I tried already so many ways to debug it. but my issue was not still resolve.
Here is my build.grade:app:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.example.app1"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.material:material:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
implementation 'com.google.code.gson:gson:2.8.6'
implementation("com.squareup.okhttp3:okhttp:4.8.1")
kapt 'com.github.bumptech.glide:compiler:4.11.0'
}
It seems you have forgot to add dependancy
try this
dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
}
also add in your this inside of your project level build.gradle file:
repositories {
google()
jcenter()
}
I am getting this error:
Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 16.0.1.
I think the error I am getting is due to implementing com.google.firebase:firebase-messaging:17.1.0 because if I remove it, building is successful. But on trying version 16.0.1 of com.google.android.gms for messaging, I get this message:
Unable to resolve error
I think the error means that com.google.firebase:firebase-messaging:16.0.1 is unavailable. How can my problem be solved ?
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
defaultConfig {
applicationId "in.anamika.anamika"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.9.7'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:design:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
in Android studio there are 2 buld gradle file.
build.gradle (Project: ProjectName)
build.gradle (Module: App)
I failed to upgrade com.google.firebase:firebase-messaging:17.1.0 too and then I edit classpath 'com.google.gms:google-services:3.0.1' to classpath 'com.google.gms:google-services:4.0.1'in build.gradle (Project: ProjectName) and it works. i can finally upgrade to 17.1.0.
Check this out
You need to search over your native dependecies in node_modules for their build.gradle and in this files look for dependecies starting with com.google.android.gms or com.google.firebase. After that you need to exclude these internal dependecies and force use of same version everywhere.
I am working on android applications where I am working on Google maps and Firebase. I am putting latest links in my gradle file but it is giving me an error with a red line on GoogleMaps gradle link.
Error:
all gms/firebase libraries must use the exact same version specification (mixinb versions can lead to runtime crahes). Found versions 16.0.0, 15.0.4, 15.0.1. Examples include com.google.firbase:firebase-analytics:16.0.0 and com.google.android.gms:play-services-measurement-base:15.0.4
Gradle:
dependencies{
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.firebase:firebase-core:16.0.0'
}
classpath 'com.google.gms:google-services:4.0.0'
apply plugin: 'com.google.gms.google-services'
Make your play service dependency version equal and try like bellow
dependencies{
compile 'com.google.android.gms:play-services-maps:16.0.0'
compile 'com.google.android.gms:play-services-location:16.0.0'
compile 'com.google.firebase:firebase-core:16.0.0'
}
classpath 'com.google.gms:google-services:4.0.0'
apply plugin: 'com.google.gms.google-services'
There are two more dependencies that need to be added. All the dependencies that I wrote are mentioned below.
compile 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.firebase:firebase-core:15.0.1'
compile 'com.google.firebase:firebase-analytics:15.0.1'
compile ' com.google.android.gms:play-services-measurement-base:15.0.4'
I got a perfect combination with Android SDK API 28
No error of any sort in gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.myapp.app"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-v4:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.github.medyo:android-about-page:1.2.4'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
hi I'm new in Kotlin and i want to do unit test.
So i add this configuration that i get from this link :
https://blog.stylingandroid.com/junit-5-getting-started/
here is what i have added:
in build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
/** Add junit5 plugin as a buildscript dependency**/
classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.0.0-M2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
and this is my app build.gradle :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
/** Run the junit's plugin as part of the build**/
apply plugin: 'de.mannodermaus.android-junit5'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.tharwa.solid.tharwa"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/**
Add a configuration for junit 5
**/
junitPlatform {
jupiterVersion '5.0.0-M3'
platformVersion '1.0.0-M3'
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.0.0-beta1'
implementation 'com.android.support:support-v4:26.0.0-beta1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:cardview-v7:26.0.0-beta1'
// retrofit
compile "com.squareup.retrofit2:retrofit:2.3.0"
//RxAndroid
compile "com.squareup.retrofit2:adapter-rxjava2:2.3.0"
compile "com.squareup.retrofit2:converter-gson:2.3.0"
// rxandroid
compile "io.reactivex.rxjava2:rxandroid:2.0.1"
//Gson
compile 'com.google.code.gson:gson:2.4'
// test dependencies
testCompile 'junit:junit:4.12' //A configuration for junit 5
testCompile junitJupiter()
testProvided "org.junit.vintage:junit-vintage-engine:4.12.0-M3"
testImplementation "org.mockito:mockito-core:2.+"
testImplementation 'android.arch.core:core-testing:1.0.0-rc1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
once i synchronise the project with Gradle Files i always got this error:
Error:No such property: javaOuptuts for class: com.android.build.gradle.internal.scope.VariantScopeImpl
Gradle sync failed: No such property: javaOuptuts for class: com.android.build.gradle.internal.scope.VariantScopeImpl
Consult IDE log for more details (Help | Show Log) (11s 191ms)
I have android 3.0.1 as a version.
I have searched and tryed several thing but it does not work for me.
Can some one help please.
it happend to me while i was upgrading my gradle in studio there was an error. i went inside the project settings it was using that build it had failed to upgrade to. i downgraded it back to the one i was using before the upgrade and it started working agian.