-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crash onActivityResult GoogleSignInApi #240
Comments
+1 |
1 similar comment
+1 |
Can anyone reliably reproduce this bug? I would be happy to investigate further if there is a way to make it happen, but right now I don't have much to go on. |
Similar me |
@samtstern I got the error from Crashlytics dashboard, and it is from my users. I don't know how to reproduce the bug reliably :( |
I got same issue on Xiaomi Mi 3w os is 6.0.1 but i got issue because i didnt check |
@manthan5493 It still happens too even we check for RESULT_OK. This is the code snippet from my onActivityResult
|
I got same issue too from my users: Library that I used: Any solutions? |
@indraazimi @manthan5493 this seems to be isolated to Xiaomi devices (I don't think it's a coincidence). Does either of you know if there are any particular modifications common to those devices? Are those users in China? I don't have any Xiaomi devices handy. |
It happens in samsung devices as well |
@olx-gaurav-mishra are you able to reproduce this? If so that would be extremely helpful, we need to capture some additional logs. As for the Xiaomi devices, it appears to me after some research that Xiaomi devices don't support Google Play Services natively and Play Services must be side loaded. If that's the case, I would not be surprised to see this and other strange failures happening. |
Well its not reproducible directly....you can only find crashes on crashlytics.....:-( |
This deliverResults flavor of issues (many very similar but slightly different crashes) is by far the main reason for crashes on our apps in Crashlytics. It seems to be related to old versions of the Google Play Services on the user's devices. It happens a lot every time we update the Google Play Services dependency and it gradually reduces over time. It is probably also related to using GoogleApiClient::enableAutoManage() and it indeed occurs on many devices not just Xiaomi. It also does not depend on the user's location since we are seeing it a lot for users currently in Spain. Additionally, this kind of crashes did not occur some months ago, but i am not sure if it only affects newer Google Play Services versions or if it started to occur due to switching from manual handling to the enableAutoManage() calls. |
+1 |
Some of my users are also experiencing the same issue. For my users it happens for Xaiomi devices. |
@imidhuntv thanks for the additional reports. Since Xiaomi devices do not natively support Google Play Services I don't believe there's anything we can do for those users. It's hard to know what version of Play Services they are running and if they got the APK from a trusted source. If anyone can reproduce this on a non-Xiaomi device that would be hugely valuable to investigating. |
I removed enable auto manage and the crashes have reduced a lot...now it is crashing very less |
@olx-gaurav-mishra Thanks for confirming that! With respect to the affected devices, just by looking at a few of the crashes related to this i see at least several Samsung, LG and Huawei devices, although few of them seem to be the latest devices from these manufacturers. Still some of them are popular devices like the S6, and there are surely more devices on the remaining issues i have in Crashlytics since they are so many due to small differences like line number offsets on the platform classes through the Android versions. It seems to me that it may be possible to at least stop sending those "results" mentioned in the crashes if they are being sent by the auto manage features of Google Play services, by doing some null checks before sending them. |
@olx-gaurav-mishra that's very interesting. I will mention that to the team as well, see if that gives them any hint as to where to look. Also would you mind sharing the code of the Activity you were using with |
@olx-gaurav-mishra how do you implement signin without |
+1 |
@KushGoyal u need to remove enableautomanage line from code and start using lifecycle callbacks for activity/fragment to connect disconnect GoogleApiclient. Refer to https://developers.google.com/identity/sign-in/android/sign-in |
Can anyone in this thread make this happen on a device they own and capture a bugreport after? The Google Sign In team (and the GoogleApiClient authors) are trying to debug this but can't get everything from the stack trace. |
I can not reproduce it directly but i have observed a few more things that may help. Firstly, it is not specific to the sign-in apis. I have an app that only uses the app invite and the location apis (but not sign-in) and it happens there too. Secondly, some of the related crashes can be catched by surrounding the call to super.onActivityResult(requestCode, resultCode, data) with a try-catch. If i report the issues occurring there as non-fatals i get slighty different stack traces like this (i have renamed the line mentioning my actual activity and source file to not reference the affected apps):
No other code from my activity is executed when this second flavor of exceptions occurs besides calling super.onActivityResult(). Finally, i have a feeling that this crashes are not repeating continuously because users very rarely complain about crashes on the app ratings. It may be that it only occurs the first time the Google Play Services check is performed or that it occurs on a background thread and it is not noticeable. But i definitely would expect more users complaining and it is not the case. Do the other developers here also have the same experience with this? Hope any of this helps to narrow the issues a bit! |
@jrgonzalezg that's super helpful, thanks for all of that. Will pass it on. |
@jrgonzalezg yes thank you very much! What version of the play-services dependencies are you using? |
Great!, i am glad that's useful since it would be very good to see this fixed. About the version, that stack trace is quite recent so it was using play-services 9.6.1 but it also happened on several previous versions. Also, not all of the errors can be catched there, some of them lead to stack traces more similar to the one posted by @hendrawd that do not go through any of the app code. |
Another one with play services 9.4.0:
And a sample of one of the not catchable exceptions (play services 9.6.1):
|
So do we have a way to prevent crash in play service 9.4.0? Thank you.
|
Its happening constantly on our S4, Note 5 and Nexus 6. All running 9.8.77 Strangely, one S4 works while the other does not, both are identical. 10-21 13:48:47.551 13245-13245/com.gox.smartrun E/UncaughtException: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=-1, data=Intent { (has extras) }} to activity {com.gox.smartrun/com.gox.smartrun.login.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.toString()' on a null object reference |
@cargo8 Thanks. We don't use singleInstance mode and KK is our supported api level and is tested for each release. Will take a look at your case once I receive the email. |
I'm using and i found this crash below from xiaomi devices (just xiaomi). i've been test in Sony, LG, Lenovo and exactly no problem, here the crash report that crash come when Google Sign In button have been clicked, no account chooser fragment to show but that crash. here's my onCreate()
} here's when Google Sign In button clicked: |
Getting similar crash in my App:
First crash occurred on WayteQ x995 with Android 4.4.2. I'm using
Google API Client init in v7.app.AppCompatActivity:
I'm just doing some logging in the ConnectionCallback Error handler and getting last Location and AppInvitation referral in onConnected. Obviously, the NPE in |
Hi. I am having such trouble too . Getting crashes from 100% Xiaomi Phones. Fatal Exception: java.lang.RuntimeException This line could have return NULL result. Check on fabric crash stats on last 90 days.. |
Are any of these issues potentially fixed in the 10.2.0 play services release? |
@nicholasrout unfortunately not that I know of. The next release that I know of with potential fixes is scheduled for April timeframe. |
Alright, thanks for the heads up @aaronj1335 |
Reproduced on Glaxy S4 Mini - delete account from the phone settings - add existing account during the signin process - crash only first time. Userpic is null and DisplayName also. Sometimes DisplayName == email. |
I also get the null Intent data onActivityResult() during Sign In. Device Intex Aqua 4G Strong used by a customer in India Below is a badly formatted stack trace :-/ `Exception java.lang.RuntimeException: Unable to resume activity {com.softwyer.collections.storage/com.softwyer.collections.core.SignInActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65538, result=0, data=null} to activity {com.softwyer.collections.storage/com.softwyer.collections.core.SignInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.common.ConnectionResult.c()' on a null object reference Caused by java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65538, result=0, data=null} to activity {com.softwyer.collections.storage/com.softwyer.collections.core.SignInActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.common.ConnectionResult.c()' on a null object reference Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int com.google.android.gms.common.ConnectionResult.c()' on a null object reference |
Even i got the crash on HTC device - I have a device in which it happens everytime if i run monkey script. I am not able to reproduce it manually, but i have noted few things. The play services is not updated and the device is not logged in with any gmail account. |
@arisembekss Your issue is different, please discuss in: @RealDigitApps User name / picture all both nullable properties. You should do null check in your code. Rest of the folks having mostly Xiaomi in Crash reports, could you try 11.0.0 SDK? Thanks. |
oh my... so many of you here if (requestCode == RC_SIGN_IN && resultCode == Activity.RESULT_OK) { and still, i even check if it's not null, but still, getting this
|
My device is Xiaomi Redmi 2, I had install google-play-store and google-services using com.google.android.gms:play-services-auth:11.0.4
Is my device reason??? |
Hi all, compile 'com.google.android.gms:play-services-maps:11.0.1' and the following is the bug report from crashlytics that i have got : Fatal Exception: java.lang.NullPointerException any views what could be the possible reason for this crash ? |
i am using google sign in working fine when i am testing in an emulator with api 24 but its crashing when i am testing in an emulator with api 23. I have also tested in two Moto X pure one having api 23 and another having api 24 same issue is replicated. I cant find any system generated issue issue in logcat . From the logs thats getting printed from the application i can see onActivityResult method is not getting called after we call the startActivityForResult(signInIntent, RC_SIGN_IN);
|
@banerjeedeba Aren't you should put |
@hendrawd I am using GoogleSignInClient's getSignInIntent method it don't have any parameter. I think u hare talking about Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient) |
@banerjeedeba If you can consistently repo the crash, would you mind sending the complete bug report to @samtstern? (his email address is listed on his profile). Thanks. |
Sure, I have mailed him the logs. |
@banerjeedeba I looked at your bug report, nothing suspicious / crashed with Google sign-in code, but seems your process was stopped before Google sign-in has a chance to finish. 01-01 16:08:34.335 1984 3261 I ActivityManager: START u0 {act=com.google.android.gms.auth.GOOGLE_SIGN_IN pkg="your package" cmp="your package"/com.google.android.gms.auth.api.signin.internal.SignInHubActivity (has extras)} from uid 10065 on display 0 01-01 16:21:06.085 1984 1995 I ActivityManager: Force stopping "your package" appid=10065 user=0: from pid 5722 I am suspecting some other code in your app tries to do some disk I/O and you don't have android.permission.READ_EXTERNAL_STORAGE permission? Totally random guess, but doesn't seem to be related to Google Sign-In. |
I was also suspecting the same that my code is doing something which is
forcing my activity to close. But as its running fine in Api 24 pixel 2
emulator I am bit confused.
I have attached a bug report of the emulator where its running fine, you
can compare them and may be get some clue where the problem is.
…On Wed, Jan 3, 2018 at 12:54 PM, isaisachen ***@***.***> wrote:
@banerjeedeba <https://github.com/banerjeedeba> I looked at your bug
report, nothing suspicious / crashed with Google sign-in code, but seems
your process was stopped before Google sign-in has a chance to finish.
01-01 16:08:34.335 1984 3261 I ActivityManager: START u0
{act=com.google.android.gms.auth.GOOGLE_SIGN_IN pkg=
cmp=/com.google.android.gms.auth.api.signin.internal.SignInHubActivity
(has extras)} from uid 10065 on display 0
...
01-01 16:08:34.361 1984 3260 I ActivityManager: START u0
{act=com.google.android.gms.auth.GOOGLE_SIGN_IN
pkg=com.google.android.gms cmp=com.google.android.gms/.auth.api.signin.ui.SignInActivity
(has extras)} from uid 10065 on display 0
...
01-01 16:17:37.810 1984 2000 E KernelUidCpuTimeReader: Caused by:
android.system.ErrnoException: open failed: ENOENT (No such file or
directory)
01-01 16:21:06.085 1984 1995 I ActivityManager: Force stopping appid=10065
user=0: from pid 5722
I am suspecting some other code in your app tries to do some disk I/O and
you don't have below permission?
Totally random guess, but doesn't seem to be related to Google Sign-In.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#240 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQQKslV_ELWIzblAMCniib-Ri0KSJCMxks5tG77YgaJpZM4I6dOK>
.
--
Regards,
Debanjan Banerjee
|
@banerjeedeba the disparity between a real device and the emulator still does not mean that the problem is in Google code rather than your own. Without a bug report showing clearly a crash in google code (or a crash at all) there's not much we can investigate. Diffing two non-crashing bugreports is unlikely to yield results. |
@banerjeedeba As I mentioned, log indicated Google Sign-In functionality was working as expected, but your app is suddenly terminated by some other error triggered by uid_cputime reading and that's NOT something triggered by Google Sign-In. So like @samtstern mentioned, sorry that we are unable to help further here. One last thing you can try to help prove our theory is, run Google Sign-In sample in this repository on the identical emulator / physical device that you could repro the issue. |
If i use it: |
make sure your activity doesn't contain "noHistory=true" @Merlinkoss |
In my case i forget to add .requestIdToken("Web application client id") in GoogleSignInOptions object .
i hope it's help you guys ! |
I am also facing the similar kind of issue only for one device Galaxy Tab3 Lite 7.0, OS version 5.0.2 Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=40962, result=-1, data=Intent { (has extras) }} to activity {example.mobile.demo/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'int java.util.List.size()' on a null object reference is there any solution for this issue? |
@pk4393 have you pass requestIdToken? |
It is the library that i used:
Here is the code for sign in
And here the code onActivityResult
Stack trace:
The text was updated successfully, but these errors were encountered: