The Error:
12-21 15:46:56.137 19795-19795/renderresults.com.wheresmycar E/AndroidRuntime: FATAL EXCEPTION: main
Process: renderresults.com.wheresmycar, PID: 19795
java.lang.IllegalStateException: Could not execute method for android:onClick
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)
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)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)
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)聽
Caused by: 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.zzdd)' on a null object reference
at com.google.android.gms.internal.zzdvv.zzb(Unknown Source)
at com.google.android.gms.internal.zzdwc.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.sendPasswordResetEmail(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.sendPasswordResetEmail(Unknown Source)
at renderresults.com.wheresmycar.ForgotPassword.Enter(ForgotPassword.java:30)
at java.lang.reflect.Method.invoke(Native Method)聽
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)聽
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)聽
my build.gradle (project)
// 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-beta7'
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
}
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "renderresults.com.wheresmycar"
minSdkVersion 25
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-core:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
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.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}
apply plugin: 'com.google.gms.google-services'
Code
package renderresults.com.wheresmycar;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
public class ForgotPassword extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.forgot_password);
}
public void Enter(View view) {
FirebaseAuth auth = FirebaseAuth.getInstance();
final EditText email = findViewById(R.id.editText3);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
FirebaseAuth.getInstance().sendPasswordResetEmail(email.getText().toString())
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
Log.d("TAG", "Email sent.");
startActivity(new Intent(ForgotPassword.this, MainActivity.class));
}
}
});
}
}
@cbscodinginc
Thread.sleep() call in your main thread?I had the same error with the following versions:
compileSdkVersion 27
buildToolsVersion "27.0.2"
targetSdkVersion 27
com.google.gms:google-services:3.1.0
com.google.firebase:firebase-auth:11.8.0
After downgrading to com.google.firebase:firebase-auth:11.2.0, the error was replaced by a prompt to update Play Services. Once I had done that, everything worked as expected. I then tried 11.8.0 again, and this time it worked as well.
@cbscodinginc Try updating Play Services if you're running this on a physical device.
This issue is almost a month old, closing since I never heard back from @cbscodinginc and @qqc seems to have solved the issue in that case.
@cbscodinginc if you're still having this issue and want to continue discussion I am happy to re-open,
Hi,
I have the same issue, this crash happen on about 0.2% of my users.
Any conclusions?
Fatal Exception: 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.zzdd)' on a null object reference
at com.google.android.gms.internal.zzdvv.zzb(Unknown Source)
at com.google.android.gms.internal.zzdwc.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.signInWithCustomToken(Unknown Source)
at com.clanplay.clanchat.firebase.FirebaseAuthenticationWrapper.authenticateWithCustomToken(FirebaseAuthenticationWrapper.java:23)
at com.clanplay.clanchat.activities.AuthActivity$3.onResponse(AuthActivity.java:185)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Hello, I have the same problem
This my code:
val credential = GoogleAuthProvider.getCredential(acct.idToken, null)
mAuth?.signInWithCredential(credential)
?.addOnCompleteListener(this) { task ->
if (task.isSuccessful) { .....
And my error:
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=-1, data=Intent { (has extras) }} to activity {ru.bytheway/ru.bytheway.ui.activity.RegistrationActivity}: 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.zzdd)' on a null object reference
at android.app.ActivityThread.deliverResults(ActivityThread.java:3702)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3745)
at android.app.ActivityThread.access$1400(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1400)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5437)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)
Caused by: 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.zzdd)' on a null object reference
at com.google.android.gms.internal.zzdvv.zzb(Unknown Source)
at com.google.android.gms.internal.zzdwc.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.signInWithCredential(Unknown Source)
I researched this issue and I found that error appear when phone doesn't have any google account.
Interesting, I will check it out. Thanks!
Same issue on emulator without google account:
Caused by: 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.signInWithCustomToken(Unknown Source)
So any better solution other than try/catch?
It seems that some of you are running into the issue discussed here:
https://github.com/firebase/FirebaseUI-Android/issues/1104
The team is aware of the issue and it should be fixed in one of the next few Firebase Auth releases. Thanks for reporting and for your patience!
@samtstern I also have this issue/crash and it did impact a lot.
Caused by 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.zzdd)' on a null object reference
at com.google.android.gms.internal.zzdvv.zzb(Unknown Source)
at com.google.android.gms.internal.zzdwc.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
at com.google.firebase.auth.PhoneAuthProvider.zza(Unknown Source)
at com.google.firebase.auth.PhoneAuthProvider.verifyPhoneNumber(Unknown Source)
at com.transcense.ava_beta.views.VerifyCodeActivity.sendVerificationCodeByFirebase(VerifyCodeActivity.java:278)
at com.transcense.ava_beta.views.VerifyCodeActivity.onCreate(VerifyCodeActivity.java:251)
at android.app.Activity.performCreate(Activity.java:6877)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3209)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3352)
at android.app.ActivityThread.access$1100(ActivityThread.java:223)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1797)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7231)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
And here is the Crashlytics link - http://crashes.to/s/c80ad0aae7c.
I don't think the crash in our app is due to FirebaseUI since we didn't use it. By the way, here is some informations which hopefully are helpful:
compileSdkVersion and targetSdkVersion are both 25.Thanks.
@skinner2012 yes yours is issue #1104. It's something in Firebase Auth and it will be fixed in the next release of that SDK.
I actually faced this error also when ever i run the the application on android emulator, but whenever i run it on my phone it worked perfectly.
so i checked the my phone google service and compared it to the emulator, which is where the problem is the version of the google services installed on the emulator is lower to the version i have on my phone and and the one i add to my dependencies.
so what i did was i updated my emulator google service to the latest one and it worked perfectly
hi @samtstern is this issue solve on "12.0.0"?
@moltak the issue persist in 12.0.0, with genymotion emulator, no google account. Works fine on real device with google account
run the app on device ,not on emulator . works fine because u have google account,signed in on your device
Most helpful comment
I researched this issue and I found that error appear when phone doesn't have any google account.