GeoFire SetLocation Not Working - android

I am trying to save a location to geofire but not getting any response from console and in logs.
I have added the dependency in gradle files and created my database reference like this:
DatabaseReference pickupRef = FirebaseDatabase.getInstance().getReference(AppConstants.PICK_UP_REF);
pickupRef.keepSynced(true);
and the string AppConstants.PICK_UP_REF equals PickUpRef. In my activity, I have done this:
Log.d(TAG, "UID in PUR:\t" + uid);
GeoFire mGeoFire = new GeoFire(pickupRef.child(uid));
if (mLastLocation != null) {
mGeoFire.setLocation(uid, new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()), new GeoFire.CompletionListener() {
#Override
public void onComplete(String key, DatabaseError error) {
if (error != null){
Log.d(TAG, "Write complete");
} else {
Log.d(TAG, "Write Failed:\t" + error.getMessage());
}
}
});
The oncompletionlistener never gets fired and nothing is updated in my database. Anyone else faced this problem or have I misconfigured it?
Here's my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.jjoey.transportr"
minSdkVersion 17
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:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:12.0.1'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-places:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.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'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'

Change your dependencies like below in app grandle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.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'
implementation 'com.android.support:cardview-v7:27.1.1'
}
And change in Project grandle:
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'

Related

H3lp m3 DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'

Could you help me to eliminate that DSL alert since as a result of this it does not allow me to link with firebase, I already tried the other groups and it does not work for me or maybe I do not know where to accommodate it
example
android {
buildFeatures {
dataBinding = true
// for view binding:
// viewBinding = true
}
}
I'm going crazy I don't know how to fix it
this is mi gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.app.womba"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.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.google.android.material:material:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.1"
// Multidex
implementation 'androidx.multidex:multidex:2.0.1'
// View Model
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//initUI
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
/// glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
/// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
/// okhttp3
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'
/// CountryCodePicker
implementation 'com.github.inpossoft:CountryCodePickerProject:2.0.0'
//image picker
implementation 'com.github.maayyaannkk:ImagePicker:1.0.4'
implementation 'com.soundcloud.android:android-crop:1.0.1#aar'
// facebook
implementation 'com.facebook.android:facebook-login:5.12.1'
//validations
implementation "com.wajahatkarim3.easyvalidation:easyvalidation-core:1.0.1"
// crashlytics
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-core:17.2.1'
// push notification
implementation 'com.google.firebase:firebase-messaging:20.1.0'
// app permission
implementation 'com.afollestad:assent:2.3.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'com.nex3z:flow-layout:1.3.0'
// Room
implementation 'androidx.room:room-runtime:2.2.3'
annotationProcessor 'androidx.room:room-compiler:2.2.3'
kapt 'androidx.room:room-compiler:2.2.3'
// socket
// implementation('io.socket:socket.io-client:0.8.3') {
// exclude group: 'org.json', module: 'json'
// }
implementation 'com.github.nkzawa:socket.io-client:0.6.0'
// double handel seekbar
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'com.wang.avi:library:2.1.3'
implementation('com.github.ganfra:material-spinner:2.0.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
//This is binah.ai sdk dependency
implementation project(path: ':bnhhrlib')
implementation 'com.jjoe64:graphview:4.2.2'
implementation files('libs/vidyoclient.jar')
implementation 'com.applandeo:material-calendar-view:1.4.0'
/**Stripe Payment Gateway*/
implementation 'com.stripe:stripe-android:12.1.0'
implementation 'com.karumi:dexter:4.2.0'
implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:3.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
// app permission
implementation 'com.afollestad:assent:2.3.1'
}
apply plugin: 'com.google.gms.google-services'
In advance thanks for the help
You'll have to replace
dataBinding {
enabled = true
}
with the recommended process
buildFeatures {
dataBinding = true
}

ClassNotFoundException: Didn't find class when using firebase library

When app deploy on play store its getting crashes with this error. Many times reported this error on crashlytics. How I can resolve I am using kotlin for our application.Also integrated firebse analytics for tracking each screen of the app and its performance.
My build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
android {
signingConfigs {
config {
storeFile file('D:\\Android Production\\Key Store\\keyTool\\allindiaitr.jks')
storePassword '12345678'
keyAlias = 'asasasasas'
keyPassword '12345678'
}
}
compileSdkVersion 28
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "dell.com.allindiaitr"
minSdkVersion 19
targetSdkVersion 28
versionCode 61
versionName "7.9"
multiDexEnabled true
resConfigs "en", "US"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// lintOptions {
// checkReleaseBuilds false
// // Or, if you prefer, you can continue to check for errors in release builds,
// // but continue the build even when errors are found:
// abortOnError false
// }
}
//configurations.all {
// resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// def requested = details.requested
// if (requested.group == "com.android.support") {
// if (!requested.name.startsWith("multidex")) {
// details.useVersion "26.+"
// }
// }
// }
//}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-core:10.2.1'
// (Recommended) Add Analytics
// implementation 'com.google.firebase:firebase-analytics:17.2.0'
// Add dependency
// implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
// implementation 'com.android.support:support-v4:28.0.0'
implementation('com.paytm:pgplussdk:1.3.3') {
transitive = true;
}
implementation 'androidx.appcompat:appcompat:1.0.2'
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'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
// implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
// implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
// implementation 'com.squareup.okhttp3:okhttp:4.2.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.bumptech.glide:glide:4.4.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
kapt "android.arch.lifecycle:compiler:1.0.0"
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation project(':filepicker')
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
implementation 'com.facebook.android:facebook-android-sdk:5.11.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//SMS User Consent API
implementation "com.google.android.gms:play-services-auth:17.0.0"
implementation "com.google.android.gms:play-services-auth-api-phone:17.1.0"
}
apply plugin: 'com.google.gms.google-services'

org.apache.http.client.utils.URLEncodedUtils not correct parse text on Android 9.0

Android Studio version 3.4
app/build.gradle:
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 18
targetSdkVersion 28
versionCode 427
versionName "2.1.427"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
def AAVersion = '4.5.2'
dependencies {
annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
annotationProcessor "org.androidannotations:ormlite:$AAVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.j256.ormlite:ormlite-android:5.1'
implementation 'commons-codec:commons-codec:1.11'
implementation 'commons-io:commons-io:2.6'
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation 'org.apache.httpcomponents:httpclient:4.3.6'
implementation "org.androidannotations:androidannotations-api:$AAVersion"
implementation "org.androidannotations:ormlite-api:$AAVersion"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
}
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
private static NotificationInvoice getNotificationInvoice(NotificationFO notification) {
String notificationText = notification.getNotificationText();
String payload = "";
NotificationType type = null;
Log.d(TAG, "check_notificationText:\n" + notificationText);
List<NameValuePair> params = URLEncodedUtils.parse(new URI(notificationText), "UTF-8");
Log.d(TAG, "check_params(" + params.size() + "):\n" + params);
}
In Android 6.0 the "notificationText" success parse to List<NameValuePair>:
check_notificationText:
http://11.1.1:54401/notify?receiver=testok&system=factura_mobile&device_type=android&type=invoice&payload=11111;0000000;5.55;2019-05-16;2019-05-16;ecb6f683-63b3-4efd-b8c3-0877f1aeae8d
check_params(5):
receiver=testok, system=factura_mobile, device_type=android, type=invoice, payload=11111;0000000;5.55;2019-05-16;2019-05-16;ecb6f683-63b3-4efd-b8c3-0877f1aeae8d
As you can see the param "payload" = 11111;0000000;5.55;2019-05-16;2019-05-16;ecb6f683-63b3-4efd-b8c3-0877f1aeae8d
Nice it's correct.
But on Android 9.0 the "notificationText" not success parse :
check_notificationText:
http://11.11.11.11:54401/notify?receiver=22222222222222&system=factura_mobile&device_type=android&type=invoice&payload=3c55ba74-a85e-401b-8c1c-40ca83947768;0000000;5.55;2019-05-16;2019-05-16;1a87fb32-4543-4111-89a4-e150a7f71168
check_params(10):
[receiver=22222222222222, system=factura_mobile, device_type=android, type=invoice, payload=3c55ba74-a85e-401b-8c1c-40ca83947768, 0000000, 5.55, 2019-05-16, 2019-05-16, 1a87fb32-4543-4111-89a4-e150a7f71168]
getNotificationInvoice_FOUND_PAYLOAD -> set_to_payload_param.getValue = 3c55ba74-a85e-401b-8c1c-40ca83947768
As you can see the param "payload" = 3c55ba74-a85e-401b-8c1c-40ca83947768 but must be
3c55ba74-a85e-401b-8c1c-40ca83947768;0000000;5.55;2019-05-16;2019-05-16;1a87fb32-4543-4111-89a4-e150a7f71168
Why URLEncodedUtils not correct parse text in Android 9.0 ?
Try to use Java in-built method java.net.URLEncoder
URLEncodedUtils is deprecated in Android API 22+
List<NameValuePair> params = URLEncoder.encode(notificationText, "UTF-8");

My application crashes after google calendar implementation in FCM messaging

I am creating the android app for booking and also I need FCM messaging in the android app.When i implement FCM messaging than it is working well but after i implement the Google calendar in app than the app is crashing when i am sending message on FCM on that line:
java.lang.NoSuchMethodError: No static method
createRootContext(II)Lcom/fasterxml/jackson/core/json/JsonReadContext;
in class Lcom/fasterxml/jackson/core/json/JsonReadContext; or its
super classes (declaration of 'com.fasterxml.jackson.core.json.JsonReadContext' appears in /data/app/com.mmf.loggedinapp-2/split_lib_dependencies_apk.apk:classes102.dex)
This is my FCM Code :
fireBaseReference.push().setValue(map);
This is my FCM code which create crashing when i am sending message on FCM
usering this method reference1.push().setValue(map);
PrefManager prefManager = new PrefManager(getApplicationContext());
Map<String, String> map = new HashMap<String, String>();
Calendar c = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String strDate = sdf.format(c.getTime());
map.put("sender_id", prefManager.getLoggedInId());
map.put("message", messageText);
map.put("time", timeString);
map.put("receiver_id", contactid);
map.put("date", strDate);
map.put("type", "mobile");
map.put("messageStatus", "0");
map.put("status", "1");
if (docUri == null) {
map.put("doc_url", "");
map.put("docFileName", "");
} else {
map.put("doc_url", docUri.toString());
map.put("docFileName", docFileName);
}
if (imageUri == null) {
map.put("imageUri", "");
map.put("imageName", "");
} else {
map.put("imageUri", imageUri.toString());
map.put("imageName", imageName);
}
reference1.push().setValue(map);
This is my build.gradle :-
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
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'
implementation 'com.android.support:design:27.1.1'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation'
com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.8.2'
implementation 'net.gotev:uploadservice:2.1'
implementation 'com.github.ome450901:SimpleRatingBar:1.3.2'
implementation 'com.vincentbrison.openlibraries.android:dualcache:3.1.1'
implementation 'org.apache.commons:commons-lang3:3.5'
implementation 'com.github.travijuu:numberpicker:1.0.7'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.andanhm.quantitypicker:quantitypicker:1.1.0'
implementation 'com.firebase:firebase-client-android:2.5.2'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.mikhaellopez:circularimageview:3.0.2'
implementation 'com.github.sundeepk:compact-calendar-view:2.0.2.3'
implementation 'com.hbb20:ccp:2.0.8'
implementation 'com.github.barteksc:android-pdf-viewer:2.3.0'
implementation 'org.apache.commons:commons-io:1.3.2'
implementation 'com.github.bumptech.glide:glide:4.3.0'
implementation 'com.wang.avi:library:2.1.3'
implementation 'io.branch.sdk.android:library:2.+'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.devlomi.record-view:record-view:2.0.0'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.stripe:stripe-android:7.0.0'
implementation 'com.amitshekhar.android:android-networking:1.0.0'
implementation 'com.github.franmontiel:FullScreenDialog:1.0.1'
implementation 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
implementation 'com.twilio:voice-android:2.0.7'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.koushikdutta.ion:ion:2.1.8'
implementation 'com.cocosw:bottomsheet:1.3.1'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'net.the4thdimension:audio-wife:1.0.3'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0'
exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-calendar:v3-rev331-
1.24.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
}
apply plugin: 'com.google.gms.google-services'

Firebase Authentication Error: I Enabled the Email/Password option

I'm trying to login to Firebase with Android, I'm getting strange messages:
Code Picture Here
login.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
final String Email,Pass;
Email=email.getText().toString();
Pass=pass.getText().toString();
if(!TextUtils.isEmpty(Email) && !TextUtils.isEmpty(Pass))
{
progressBar.setVisibility(View.VISIBLE);
if(Pass.length()>=6)
{
auth = FirebaseAuth.getInstance();
auth.signInWithEmailAndPassword(Email, Pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task)
{
progressBar.setVisibility(View.INVISIBLE);
if (task.isSuccessful())
{
Intent i = new Intent(login.this, MainActivity.class);
i.putExtra("Email",Email);
startActivity(i);
finish();
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "" + task.getException(), Toast.LENGTH_SHORT).show();
}
}
});
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "Password Must be 8 Character Long", Toast.LENGTH_SHORT).show();
}
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "Provide Email and Password", Toast.LENGTH_SHORT).show();
}
}
});
build.Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.butt************"
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'
}
}
}
dependencies {
compile 'com.google.firebase:firebase-database:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
compile 'com.google.firebase:firebase-auth:11.8.0'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:gridlayout-v7:27.0.1'
apply plugin: 'com.google.gms.google-services'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
With the Error Message:
W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms
D/ViewRootImpl: Buffer Count from app info with ::-1 && -1 for ::
com.butt.mediacalradar from View :: -1 DBQ Enabled ::false false
"com.google.firebase.FirebaseException. An internal Error Occur [Bad Request]".
After Updating
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com**********"
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'
}
}
}
dependencies {
//compile 'com.google.firebase:firebase-database:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
compile 'com.google.firebase:firebase-auth:16.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:gridlayout-v7:27.0.1'
apply plugin: 'com.google.gms.google-services'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
}
apply plugin: 'com.google.gms.google-services'
In order to make it work, please use the last versions for all your dependencies:
First change google services version (build.gradle Project) to:
classpath 'com.google.gms:google-services:4.0.1'
And the dependencies from:
compile 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
to
//compile 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
As you can see, the first line is commented. Don't also forget to delete the duplicate apply plugin: 'com.google.gms.google-services'. Should remain only at the end of the file.

Categories

Resources