How to solve hashmap to string problem in android - android

I'm Trying to read data from Firebase but app crashes on generate error in logcat below. I have tried all solutions available on stackoverflow and other sites but still i m failed to solve this issue I have made changes and shared necessary code here
.gradle Project (dependencies)
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
}
app.gradle (dependencies)
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
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-annotations:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
}
main.java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
FirebaseApp.initializeApp(getApplicationContext());
initViews();
mBtn.setOnClickListener(this::readData);
}
public void readData(View view) {
mRef.addValueEventListener(new ValueEventListener() {
#Override
public void onDataChange(#NonNull DataSnapshot dataSnapshot) {
String data = dataSnapshot.getValue(String.class);
setT.setText(data);
}
#Override
public void onCancelled(#NonNull DatabaseError databaseError) {
setT.setText("Sorry Data");
}
});
}
private void initViews() {
mBtn = findViewById(R.id.mBtn);
setT = findViewById(R.id.setT);
}
}
Logcat

try replace your database implementation version 17.0.0 to this version
implementation 'com.google.firebase:firebase-database:16.0.5'
and it will work

Related

Firebase Messaging Dependencies Issue

I've been trying to add Firebase cloud messaging to my app but can't get pass this issue. Whenever I include firebase messaging in my android>app>build.gradle, my app launches but the immediately closes then just hangs on "Installing build\app\outputs\apk\app.apk":
implementation 'com.google.firebase:firebase-messaging:20.1.6'
android>app>build.gradle:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:16.0.1'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-messaging:20.1.6'
}
apply plugin: 'com.google.gms.google-services'
android>build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
I'm not sure whether this is a versioning issue?
Regarding to release notes
The Firebase Android library firebase-core is no longer needed. This
SDK included the Firebase SDK for Google Analytics.
https://firebase.google.com/support/release-notes/android
Also, use google play service plugin version 4.3.3
classpath com.google.gms:google-services:4.3.3
Your could use bom(Bill Of Material) of firebase like this:
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-messaging'
then to import (in your activity):
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.messaging.FirebaseMessaging;
.
.
#Override
protected void attachBaseContext(Context newBase) {
FirebaseMessaging.getInstance().subscribeToTopic("all").addOnSuccessListener(new OnSuccessListener<Void>() {
#Override
public void onSuccess(Void aVoid) {
Log.e("my_tag", "successfully register in topic");
}
}).addOnFailureListener(new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
Log.e("my_tag", e.getMessage());
}
});
}

Pinterest sdk callback class error: cannot access Response class file for com.android.volley.Response not found

I am trying to integrate Pinterest for sharing blog/creating a pin. I am following the official documentation, tutorial1 and tutorial2 to integrate the Pinterest.
But, the issue is when I try to authorize the user and pass PDKCallback object into the login method as shown below,
pdkClient.login(this, scopes, new PDKCallback() {
#Override
public void onSuccess(PDKResponse response) {
Log.d(getClass().getName(), response.getData().toString());
//user logged in, use response.getUser() to get PDKUser object
}
#Override
public void onFailure(PDKException exception) {
Log.e(getClass().getName(), exception.getDetailMessage());
}
});
It shows me the following compilation error
cannot access Response class file for com.android.volley.Response not found
Can anybody help me with this problem?
Edit
My pdk module gradle file is as follows:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
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:21.0.3'
implementation 'com.android.volley:volley:1.1.1'
// implementation 'com.mcxiaoke.volley:library:1.0.19'
}
My app module build.gradle file's dependency is as follows
dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.5.2#aar')
{
transitive = true
}
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.firebase:firebase-client-android:2.4.0'
implementation 'com.plattysoft.leonids:LeonidsLib:1.3.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation project(':wScratchViewLibrary')
implementation project(':linkedin-sdk')
implementation project(':pdk')
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.3.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.j256.ormlite:ormlite-android:4.48'
implementation 'com.j256.ormlite:ormlite-core:4.48'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.google.android.gms:play-services-vision:15.0.2'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
implementation 'com.facebook.android:facebook-share:4.33.0'
implementation ('com.twitter.sdk.android:twitter:3.3.0#aar') {
transitive = true
}
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
implementation "com.mixpanel.android:mixpanel-android:5.4.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.wang.avi:library:2.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.6.0'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
implementation files('libs/nineoldandroids-library-2.4.0.jar')
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.cooltechworks:ScratchView:v1.1'
}
My PinterestApi class from which I try to access the login method of pdk.
package com.veriloginqr.android.sharing_apis;
import android.content.Context;
import android.util.Log;
import com.pinterest.android.pdk.PDKCallback;
import com.pinterest.android.pdk.PDKClient;
import com.pinterest.android.pdk.PDKException;
import com.pinterest.android.pdk.PDKResponse;
import java.util.ArrayList;
import java.util.List;
public class PinterestApi {
private static final String appID = "my_app_id_i_wont_reveal";
private PDKClient pdkClient;
private Context context;
public PinterestApi(Context context) {
this.context=context;
// Call configureInstance() method with context and App Id
pdkClient = PDKClient.configureInstance(context, appID);
// Call onConnect() method to make link between App id and Pinterest SDK
pdkClient.onConnect(context);
PDKClient.setDebugMode(true);
}
public void authorizeUser(){
List<String> scopes = new ArrayList<>();
scopes.add(PDKClient.PDKCLIENT_PERMISSION_READ_PUBLIC);
scopes.add(PDKClient.PDKCLIENT_PERMISSION_WRITE_PUBLIC);
pdkClient.login(context,scopes,new PDKCallback(){
#Override
public void onSuccess(PDKResponse response) {
Log.d(getClass().getName(), response.getData().toString());
//user logged in, use response.getUser() to get PDKUser object
}
#Override
public void onFailure(PDKException exception) {
Log.e(getClass().getName(), exception.getDetailMessage());
}
});
}
}
Note: You can check the pdk source code here.
try changing the volley version from 1.0.0 to 1.0.1 like this
implementation 'com.android.volley:volley:1.1.1'
or I think you should be adding volley in your app’s build.gradle
Imports & codes seems fine. The issue seems to be not downloading the whole dependency nor, there was a problem when building which needs a rebuild-clean project.
The solution will be using the latest version:
implementation 'com.android.volley:volley:1.1.1'
And making sure offline work not checked in the Settings.

ViroCore: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/vr/ndk/base/GvrLayout;

I have downloaded ViroCore lib the latest version (virocore-release-v_1_7_2.aar), then I added dependencies below to my build.gradle file
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.0.0'
implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
implementation (name:'virocore-release-v_1_7_2', ext: 'aar')
implementation 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
implementation 'com.amazonaws:aws-android-sdk-core:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-ddb:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-ddb-mapper:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-cognito:2.2.+'
implementation 'com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.2.+'}
and then wrote to my ViroActivity code below:
private ViroView createGVRView() {
return new ViroViewGVR(this, new ViroViewGVR.StartupListener() {
#Override
public void onSuccess() {
onRendererStart();
}
#Override
public void onFailure(ViroViewGVR.StartupError error, String errorMessage) {
onRendererFailed(error.toString(), errorMessage);
}
}, new Runnable() {
#Override
public void run() {
}
});
}
But when run the app, I always see next Exception:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.virosample.gvr.ovr, PID: 17304
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/vr/ndk/base/GvrLayout;
at com.viro.core.ViroViewGVR.init(ViroViewGVR.java:287)
at com.viro.core.ViroViewGVR.<init>(ViroViewGVR.java:211)
at com.example.panorama.ui.view.ViroActivityVR.createGVRView(ViroActivityVR.java:104)
at com.example.panorama.ui.view.ViroActivityVR.onCreate(ViroActivityVR.java:90)
...
Anyone knows how to resolve this exception?
I solved this issue. I added to my dependency just viro library, but I must add additionally both sdk-common.aar and core.aar which you can download at the official virocore site.

FirebaseAuth.signInWithEmailAndPassword() doesn't work with the new firebase sdk version

I recently updated my firebase sdk version to the latest and all of a sudden the FirebaseAuth.signInWithEmailAndPassword() doesn't work anymore and it shows me this error:
W/Binder: Binder call failed.
com.google.android.gms.internal.firebase_auth.zzv: java.lang.NullPointerException: Attempt to invoke virtual method 'org.json.JSONObject com.google.firebase.auth.internal.zzm.zzbf()' on a null object reference
This is my code:
mAuth.signInWithEmailAndPassword(email.getText().toString(), password.getText().toString())
.addOnFailureListener(new OnFailureListener() {
#Override
public void onFailure(#NonNull Exception e) {
Log.v("trtrrt",e.toString());
}
}).addOnSuccessListener(new OnSuccessListener<AuthResult>() {
#Override
public void onSuccess(AuthResult authResult) {
Log.v("trtrrt","success");
}
});
The weird thing is when i enter a wrong email and password it calls the OnFailureListener, but if I enter a right email and password neither OnSuccessListener nor OnFailureListener get called.
Here is my current dependencies:
dependencies {
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.12.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.12.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.google.android.gms:play-services-maps:15.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:design:27.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:support-vector-drawable:27.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'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-location:15.0.0'
implementation 'com.google.android.gms:play-services-places:15.0.0'
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-crash:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.1.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-functions:15.0.0'
implementation 'com.simplify:simplify-android:3.0.0'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.android.support:multidex:1.0.1'
}
My problem wasn't because i didn't use
mAuth = FirebaseAuth.getInstance();
the sign in method was working fine before i upgraded the version of the Firebase SDK.
However, i solved the problem when i downgraded the firebase-auth dependence to:
implementation 'com.google.firebase:firebase-auth:15.0.0'
Please check this:
mAuth=FirebaseAuth.getInstace();
before calling signinWithEmailAndPass method on it.
mAuth = FirebaseAuth.getInstance();
on your btn login click call this method
private void loginUser(String email, String password) {
mAuth.signInWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task) {
if (task.isSuccessful()){
mpProgressDialog.dismiss();
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
finish();
}else{
mpProgressDialog.hide();
Toast.makeText(LoginActivity.this,"Something error !!!",Toast.LENGTH_SHORT).show();
}
}
});
}

firebase android user database Sign up Error

I was doing this tutorial on Android and Firebase but for some reason when I try to register a new driver it doesn't interact with Firebase at all. Though it does show it's connected to Firebase:
I have downgraded my API to 26 because of this error:
Google Play services out of date. Requires 9256000 but found 9080470.
So I installed Genymotion to solve this issue as advised by contributors on this platform.
But it still doesn't communicate with Firebase. It returns 0 Errors and yet doesn't work.
I've installed GenyMotion but every time I try to run on it's devices it keeps crashing.
public class DriverLoginActivity extends AppCompatActivity {
private EditText mEmail, mPassword;
private Button mLogin, mRegistration;
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener firebaseAuthListener;
private static final String TAG = "Test";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_driver_login);
mAuth = FirebaseAuth.getInstance();
firebaseAuthListener = new FirebaseAuth.AuthStateListener() {
#Override
public void onAuthStateChanged(#NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
if(user!=null){
Intent intent = new Intent(DriverLoginActivity.this,
MainActivity.class);
startActivity(intent);
finish();
return;
}
}
};
mEmail = findViewById(R.id.email);
mPassword = findViewById(R.id.password);
mLogin = findViewById(R.id.login);
mRegistration = findViewById(R.id.registration);
mRegistration.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
final String email = mEmail.getText().toString();
final String password = mPassword.getText().toString();
mAuth.createUserWithEmailAndPassword(email,
password).addOnCompleteListener(DriverLoginActivity.this, new
OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task) {
if(!task.isSuccessful()){
Toast.makeText(DriverLoginActivity.this, "sign up
error", Toast.LENGTH_SHORT).show();
}else {
String user_id = mAuth.getCurrentUser().getUid();
DatabaseReference current_user_db =
FirebaseDatabase.getInstance().getReference().child("Users").child("Drivers").child(user_id);
current_user_db.setValue(true);
}
}
});
}
});
mLogin.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
final String email = mEmail.getText().toString();
final String password = mPassword.getText().toString();
mAuth.signInWithEmailAndPassword(email, password).addOnCompleteListener(DriverLoginActivity.this, new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task) {
Log.d(TAG, "createUserWithEmail:onComplete:" + task.isSuccessful());
if(!task.isSuccessful()){
Log.d(TAG, "onComplete: Failed=" + task.getException().getMessage());
Toast.makeText(DriverLoginActivity.this, "sign up error", Toast.LENGTH_SHORT).show();
}
}
});
}
});
}
#Override
protected void onStart() {
super.onStart();
mAuth.addAuthStateListener(firebaseAuthListener);
}
#Override
protected void onStop() {
super.onStop();
mAuth.removeAuthStateListener(firebaseAuthListener);
}
}
Here are my build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "ke.co.wafalmelogistics.wafalme"
minSdkVersion 17
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 {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.gms:google-services:3.1.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.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'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (module)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
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 {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here is the Error I keep getting when I try to run the app on GenyMotion;
--------- beginning of crash
E/AndroidRuntime: FATAL EXCEPTION: main
Process: ke.co.wafalmelogistics.wafalme, PID: 1640
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.android.gms.common.api.GoogleApi.zzb(com.google.android.gms.common.api.internal.zzdf)' on a null object reference
at com.google.android.gms.internal.zzdtp.zzb(Unknown Source)
at com.google.android.gms.internal.zzdtw.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.createUserWithEmailAndPassword(Unknown Source)
at ke.co.wafalmelogistics.wafalme.DriverLoginActivity$2.onClick(DriverLoginActivity.java:61)
at android.view.View.performClick(View.java:5637)
at android.view.View$PerformClick.run(View.java:22429)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
ItI am a learner, any help is appreciated.
I get the same error because I was use Emulator ..
but when I try it in a real device it is working perfectly ..
Hope it works for you too..
Worked for me using these dependencies:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.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'
//NOT DEFAULT BELOW
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.android.support:design:26.1.0'
compile 'com.github.rtoshiro.mflibrary:mflibrary:1.0.0'
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
}
Thank you for all the help.
I have the same problem when I use 'com.google.firebase:firebase-auth:11.6.0'
change to 'com.google.firebase:firebase-auth:11.2.0'
`
Try this dependencies:
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.google.firebase:firebase-database:11.2.0'
compile 'com.google.firebase:firebase-crash:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.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'
had the same issue in my project while running in the emulator but I solved this by using this in Android Studio 3.0.1
app/build.gradle
compile "com.google.firebase:firebase-auth:9.0.2"
build.gradle ( root directory )
classpath 'com.google.gms:google-services:3.0.0'
there setting work for me
Looking at https://github.com/firebase/FirebaseUI-Android/issues/1104. I think this is an acknowledged issue in the SDK that would be resolved in the next 1 or 2 SDK updates. A github user called Samstern posts this -
A fix for this bug has been submitted internally, so this should be
fixed in the next 1-2 Firebase Auth SDK releases depending on the
release cycle.
I am going to close this issue here since there's nothing more
FIrebaseUI can do, thanks for everyone who reported it!
Nonetheless, try the following and see if it works. To repeat what Bob Snyder said - Delete this line from the dependencies block: implementation 'com.google.gms:google-services:3.1.0'. Upgrade your firebase to 11.8.0. So your app's build.gradle should look like something like this.
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
Let me know how that goes.
I solved this by upgrading Google Play Services in the emulator. It was not necessary to change anything in gradle.
For me works change from compile:
com.google.firebase:firebase-auth:11.8.0
to compile:
com.google.firebase:firebase-auth:11.2.0

Categories

Resources