Skip to content
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

Application wont proceed further #29

Closed
nepal12 opened this issue Oct 1, 2019 · 22 comments
Closed

Application wont proceed further #29

nepal12 opened this issue Oct 1, 2019 · 22 comments

Comments

@nepal12
Copy link

nepal12 commented Oct 1, 2019

Hi, I have created my own package and followed all your steps. On application start after pressing Sign in with google I get a dialog box with account selection However when I select my gmail , application, there will be a quick flicker on
the screen then application shows me the start page where it asks me to "Sign In with google". I get following error:

W/ActivityThread(29757): handleWindowVisibility: no activity for token android.os.BinderProxy@81c22e0
I/flutter (29757): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
I/flutter (29757): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:344:48)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #3      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:218:23)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #4      GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:257:20)
I/flutter (29757): #5      GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:324:48)
I/flutter (29757): #6      AuthenticationProvider.signInWithGoogle (package:blabla/providers/AuthenticationProvider.dart:18:28)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #7      AuthenticationRepository.signInWithGoogle (package:blabla/repositories/AuthenticationRepository.dart:11:30)
I/flutter (29757): #8      AuthenticationBloc.mapClickedGoogleLoginToState (package:blabla/blocs/authentication/AuthenticationBloc.dart:77:42)
I/flutter (29757): <asynchronous suspension
@adityadroid
Copy link
Owner

Hi, I have created my own package and followed all your steps. On application start after pressing Sign in with google I get a dialog box with account selection However when I select my gmail , application, there will be a quick flicker on
the screen then application shows me the start page where it asks me to "Sign In with google". I get following error:

W/ActivityThread(29757): handleWindowVisibility: no activity for token android.os.BinderProxy@81c22e0
I/flutter (29757): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
I/flutter (29757): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #2      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:344:48)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #3      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:218:23)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #4      GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:257:20)
I/flutter (29757): #5      GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:324:48)
I/flutter (29757): #6      AuthenticationProvider.signInWithGoogle (package:blabla/providers/AuthenticationProvider.dart:18:28)
I/flutter (29757): <asynchronous suspension>
I/flutter (29757): #7      AuthenticationRepository.signInWithGoogle (package:blabla/repositories/AuthenticationRepository.dart:11:30)
I/flutter (29757): #8      AuthenticationBloc.mapClickedGoogleLoginToState (package:blabla/blocs/authentication/AuthenticationBloc.dart:77:42)
I/flutter (29757): <asynchronous suspension

Can you post your code?
Or link to the project repo, preferably.

@nepal12
Copy link
Author

nepal12 commented Oct 3, 2019

Can you post your code?
Or link to the project repo, preferably.

https://github.com/nepal12/blabla

@adityadroid
Copy link
Owner

Can you post your code?
Or link to the project repo, preferably.

https://github.com/nepal12/blabla

I checked your code. This seems to be an issue with the google-services.json file in your andorid/app directory.
Try removing that file and downloading and adding it again. Make sure:

  1. That the SHA1 you enter while generating google-services.json is correct.
  2. The package name is correct.

Refer
Firestore Token retrieval failed: INVALID_SENDER

@adityadroid
Copy link
Owner

@nepal12 is the issue solved?

@adityadroid
Copy link
Owner

I think I've clarified your doubts. Feel free to open this issue back if needed.

@lakshit1
Copy link

lakshit1 commented Oct 7, 2019

I am also not able to login to app but i had added both sha, enabled google login, enabled database and storage.

@adityadroid
Copy link
Owner

I am also not able to login to app but i had added both sha, enabled google login, enabled database and storage.

Can you post logs ?

@adityadroid adityadroid reopened this Oct 7, 2019
@lakshit1
Copy link

lakshit1 commented Oct 7, 2019

I will be able to post log tomorrow. So, please wait for some time.

@adityadroid
Copy link
Owner

I will be able to post log tomorrow. So, please wait for some time.

okay.

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

When i build this app and install it then i am not able to login but when i install this app running it from vscode then i am able to login. Is this an issue or anything else ?

@adityadroid
Copy link
Owner

When i build this app and install it then i am not able to login but when i install this app running it from vscode then i am able to login. Is this an issue or anything else ?

Are you using the same build environment in both places? I think you have different android SDK setup for VSCode and AS. You should either use the same SDK on both the places and use the SHA1 from that SDK. (SHA1 is generated using the debug key, which is generally the part of the android SDK unless you explicitly set it).

What you can do is:

  1. Use any one editor and use the SHA1 from that editor to generate google-services.json.
    Or
  2. Use a common android SDK in both the editors.

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

Sorry for this much disturbance. I want to know that how to add another user. I had logged in from two devices with different accounts.

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

When i build this app and install it then i am not able to login but when i install this app running it from vscode then i am able to login. Is this an issue or anything else ?

Are you using the same build environment in both places? I think you have different android SDK setup for VSCode and AS. You should either use the same SDK on both the places and use the SHA1 from that SDK. (SHA1 is generated using the debug key, which is generally the part of the android SDK unless you explicitly set it).

What you can do is:

  1. Use any one editor and use the SHA1 from that editor to generate google-services.json.
    Or
  2. Use a common android SDK in both the editors.

Ok

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

I had already tried to add user by username option but not able to add user.

@adityadroid
Copy link
Owner

What issue are you facing while adding users? Can you explain/post logs?

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

Screenshot (52)

This is the screen shot of error while adding user

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

Screenshot (50)

This the screenshot while logging in to application.

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

These rules are defined in database.

Screenshot (53)

@adityadroid
Copy link
Owner

In the last two lines remove the condition which checks for uid matching.
I'll write a separate post on firebase rules towards the end of this series.

@lakshit1
Copy link

lakshit1 commented Oct 8, 2019

Screenshot (55)

like this ?

@adityadroid
Copy link
Owner

Yes. This will work.

@adityadroid
Copy link
Owner

Closing the issue for now. Feel free to open it back if the issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants