error running firebase email invite code [duplicate] - android

I'm having a problem with Google Services plugin.
I updated google services to the latest version. I got a dependency from this site: https://bintray.com/android/android-tools/com.google.gms.google-services/
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.2.0.
This are my Gradle files:
The one in app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "********"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.mikepenz:materialdrawer:5.2.0#aar') {
transitive = true
}
compile(name: 'toolkit', ext: 'aar')
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
compile 'com.jmedeisis:draglinearlayout:1.1.0'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.gms:google-services:3.1.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.firebase:firebase-storage:11.2.0'
compile 'com.android.support:design:25.3.1'
compile 'com.itextpdf:itext-pdfa:5.5.10'
compile 'com.itextpdf:itextg:5.5.9'
compile 'com.mikepenz:google-material-typeface:2.2.0.1#aar'
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mikepenz:itemanimators:0.2.4#aar'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
One in the project:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Use the same version of firebase and Google play services
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
//Remove this dependency
//compile 'com.google.gms:google-services:3.1.1'
//Add this dependency if you need Google play services
compile 'com.google.android.gms:play-services:11.4.2'

I found this soloution
build.girdle ->
dependencies {
classpath 'com.google.gms:google-services:4.0.1' //(use this latest one)
}
instead of classpath 'com.google.gms:google-services:3.0.0' xxx (Remove this)
Hope this will work

Related

Firebase API initialization failure.java.lang.reflect.InvocationTargetException

I have integrated the FCM Database in my Android project. I used it for chat application. Now I need to implement the cloud message(Push notification) using FireBase. After I implement the FCM, I got an error-
Firebase API initialization failure. java.lang.reflect.InvocationTargetException
I am sending the gradle script please have a look.
Module :app
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.swatin.groupchatapplication"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(':libbambuser-0.9.12')
compile 'com.basgeekball:awesome-validation:1.3'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.1.0'
compile 'com.razorpay:checkout:1.4.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui:2.0.1'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.okhttp3:okhttp:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.volley:volley:1.1.0-rc1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.paypal.sdk:paypal-android-sdk:2.14.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (Project: ProjectName)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To solve this, you need to add the following line of code:
apply plugin: 'com.google.gms.google-services'
As the last line in your build.gradle (Project: ProjectName) file.
And if you are using also authentication, please also this line of code:
compile 'com.google.android.gms:play-services-auth:10.0.1'
I also strongly recommend you to use the latest versions for your Firebase dependencies. The latest version is now: 11.8.0.
The last version for Google Play Services is:
classpath 'com.google.gms:google-services:3.2.0'

I receive error for 'import com.firebase.client.Firebase;' on Android

I am working on a project using Firebase, but after updating the versions, I receive an error for 'import com.firebase.client.Firebase;'.
I cleaned the project, rebuilt, and deleted from local and imported from github where I stored the information.
Here is my build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {url 'https://jitpack.io'}
maven {url 'https://maven.google.com'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and here is my build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example.android"
minSdkVersion 19
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'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.android.support:cardview-v7:26.0.0-alpha1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.zxing:core:3.2.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.wdullaer:MaterialDateTimePicker:v3.0.0'
compile 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
here is an error I have
screenshot of error
try following to adding this line in gradle file.
compile 'com.firebase:firebase-client-android:2.5.0'

Error : Please fix the version conflict either by updating the version of the google-services plugin

I'm having a problem with Google Services plugin.
I updated google services to the latest version. I got a dependency from this site: https://bintray.com/android/android-tools/com.google.gms.google-services/
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.2.0.
This are my Gradle files:
The one in app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "********"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.mikepenz:materialdrawer:5.2.0#aar') {
transitive = true
}
compile(name: 'toolkit', ext: 'aar')
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
compile 'com.jmedeisis:draglinearlayout:1.1.0'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.gms:google-services:3.1.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.firebase:firebase-storage:11.2.0'
compile 'com.android.support:design:25.3.1'
compile 'com.itextpdf:itext-pdfa:5.5.10'
compile 'com.itextpdf:itextg:5.5.9'
compile 'com.mikepenz:google-material-typeface:2.2.0.1#aar'
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.mikepenz:itemanimators:0.2.4#aar'
compile 'com.android.support:support-v4:25.3.1'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
One in the project:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Use the same version of firebase and Google play services
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4.2'
//Remove this dependency
//compile 'com.google.gms:google-services:3.1.1'
//Add this dependency if you need Google play services
compile 'com.google.android.gms:play-services:11.4.2'
I found this soloution
build.girdle ->
dependencies {
classpath 'com.google.gms:google-services:4.0.1' //(use this latest one)
}
instead of classpath 'com.google.gms:google-services:3.0.0' xxx (Remove this)
Hope this will work

Firebase Android Studio (2.2.3) issue

I am facing a problem to compile Firebase in my android project.Here is my app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "<my_app_id>"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And here is the build gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting an error of Failed to resolve : com.google.firebase:firebase-core:10.2.1
If you are using android studio,
Goto tools -> Firebase
And follow on screen instructions. Android studio take care of the dependency issues.
Change
compile 'com.google.android.gms:play-services-auth:10.2.1'
to
compile 'com.google.android.gms:play-services-auth:10.0.1'
It works for me.
update your play service version and also update firebase dependency version.

Version conflict in gradle while adding com.google.gms.google-services

I was adding firebase cloud messaging to my project using the assistant, I encountered the following error message while android studio was building the project :
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 9.8.0.
Here are the build files:
top-level:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app-level:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "in.ac.iitb.treeplantationapp"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:design:25.0.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.android.gms:play-services:10.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
You are using different versions of the google play services:
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.android.gms:play-services:10.0.0'
compile 'com.google.firebase:firebase-messaging:10.0.1'
Use:
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'

Categories

Resources