firebase / FirebaseUI-Android

Optimized UI components for Firebase
https://firebaseopensource.com/projects/firebase/firebaseui-android/
Apache License 2.0
4.63k stars 1.84k forks source link

Google Login Not Working #56

Closed troy21688 closed 8 years ago

troy21688 commented 8 years ago

I have set up all of my Google login information, and when I click on the Google button I am prompted to select a gmail / Google account. However, after I select the gmail account to use, I am receiving an error that states "user closed login dialog." Anybody experience this issue or know how to resolve?

puf commented 8 years ago

The value you enter for GoogleClientId needs to be a OAuth client ID for a web application. Most likely you entered an Android client ID.

troy21688 commented 8 years ago

I am setting it up for Android, do I still need to create it for a web application?

On Sat, Jan 9, 2016 at 6:42 PM, Frank van Puffelen <notifications@github.com

wrote:

The value you enter for GoogleClientId needs to be a OAuth client ID for a web application. Most likely you entered an Android client ID.

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297085 .

Troy Chuinard, CPA

puf commented 8 years ago

Yes. Firebase Authentication is web based, even when you use it from an Android app. Your users won't notice this, but you'll need to specify the key for a web application.

On Sat, Jan 9, 2016 at 4:43 PM troy21688 notifications@github.com wrote:

I am setting it up for Android, do I still need to create it for a web application?

On Sat, Jan 9, 2016 at 6:42 PM, Frank van Puffelen < notifications@github.com

wrote:

The value you enter for GoogleClientId needs to be a OAuth client ID for a web application. Most likely you entered an Android client ID.

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297085

.

Troy Chuinard, CPA

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297114 .

troy21688 commented 8 years ago

I am still getting the same error. On Jan 9, 2016 11:03 PM, "Frank van Puffelen" notifications@github.com wrote:

Yes. Firebase Authentication is web based, even when you use it from an Android app. Your users won't notice this, but you'll need to specify the key for a web application.

On Sat, Jan 9, 2016 at 4:43 PM troy21688 notifications@github.com wrote:

I am setting it up for Android, do I still need to create it for a web application?

On Sat, Jan 9, 2016 at 6:42 PM, Frank van Puffelen < notifications@github.com

wrote:

The value you enter for GoogleClientId needs to be a OAuth client ID for a web application. Most likely you entered an Android client ID.

— Reply to this email directly or view it on GitHub <

https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297085

.

Troy Chuinard, CPA

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297114

.

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170315455 .

troy21688 commented 8 years ago

I will experiment, but I did change it to a web-based token. It appears I am getting the same error. Have other people experienced this issue?

On Sat, Jan 9, 2016 at 11:03 PM, Troy Chuinard tccpg288@gmail.com wrote:

I am still getting the same error. On Jan 9, 2016 11:03 PM, "Frank van Puffelen" notifications@github.com wrote:

Yes. Firebase Authentication is web based, even when you use it from an Android app. Your users won't notice this, but you'll need to specify the key for a web application.

On Sat, Jan 9, 2016 at 4:43 PM troy21688 notifications@github.com wrote:

I am setting it up for Android, do I still need to create it for a web application?

On Sat, Jan 9, 2016 at 6:42 PM, Frank van Puffelen < notifications@github.com

wrote:

The value you enter for GoogleClientId needs to be a OAuth client ID for a web application. Most likely you entered an Android client ID.

— Reply to this email directly or view it on GitHub <

https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297085

.

Troy Chuinard, CPA

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170297114

.

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170315455 .

Troy Chuinard, CPA

mysliwiec-tech commented 8 years ago

I experience the same problems as @troy21688. In logcat I see "user closed login dialog"

troy21688 commented 8 years ago

It also looks like the official Google documentation has different instructions. It does not mention adding the meta-data to the Manifest file, and I am uncertain what key to add to my Strings.xml file. The json file that you have to create has its own key, however the instructions also say to add an Auth 2.0 key for the web server. Very confusing, has anyone actually gotten the Google Sign In to work? Here are the instructions I am following, directly from Google: https://developers.google.com/identity/sign-in/android/start-integrating

puf commented 8 years ago

I enable Google auth regularly using FirebaseUI. But the steps are convoluted indeed. Look for the 0.3.1 release to drastically simplify what you need to do in your Android project. But the steps in the developer console will remain the same: you will need (at least) two OAuth 2.0 client IDs. One of type "Web application" and one of type Android, which matches the package name of your app and SHA1 of the machine where you run the gradle build/Android Studio.

On Mon, Jan 11, 2016 at 12:13 PM troy21688 notifications@github.com wrote:

It also looks like the official Google documentation has different instructions. It does not mention adding the meta-data to the Manifest file, and I am uncertain what key to add to my Strings.xml file. The json file that you have to create has its own key, however the instructions also say to add an Auth 2.0 key for the web server. Very confusing, has anyone actually gotten the Google Sign In to work? Here are the instructions I am following, directly from Google: https://developers.google.com/identity/sign-in/android/start-integrating

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170675778 .

troy21688 commented 8 years ago

Thanks for filling me in Frank. Definitely new to this process and programming in general. Regardless of how many apps I have and the number of keystore files I generate for Android, do I always only have 1 SHA1 key? I want to make sure that I didn't duplicate those on accident when I created multiple keystore files.

Also, when do you expect the new UI library to be released?

Appreciate the help.

-Troy

On Mon, Jan 11, 2016 at 2:42 PM, Frank van Puffelen < notifications@github.com> wrote:

I enable Google auth regularly using FirebaseUI. But the steps are convoluted indeed. Look for the 0.3.1 release to drastically simplify what you need to do in your Android project. But the steps in the developer console will remain the same: you will need (at least) two OAuth 2.0 client IDs. One of type "Web application" and one of type Android, which matches the package name of your app and SHA1 of the machine where you run the gradle build/Android Studio.

On Mon, Jan 11, 2016 at 12:13 PM troy21688 notifications@github.com wrote:

It also looks like the official Google documentation has different instructions. It does not mention adding the meta-data to the Manifest file, and I am uncertain what key to add to my Strings.xml file. The json file that you have to create has its own key, however the instructions also say to add an Auth 2.0 key for the web server. Very confusing, has anyone actually gotten the Google Sign In to work? Here are the instructions I am following, directly from Google: https://developers.google.com/identity/sign-in/android/start-integrating

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170675778

.

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170683784 .

Troy Chuinard, CPA

troy21688 commented 8 years ago

Also, not sure if I am doing something wrong, but I am getting an error with the Twitter login as well. Let me know if the Twitter login is being updated in the next release and I will ignore for now:

01-11 15:04:20.474 31823-31823/? D/AndroidRuntime: Shutting down VM 01-11 15:04:20.474 31823-31823/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41819da0) 01-11 15:04:20.474 1181-1181/? D/WfcActivityStateReceiver: onReceive(): packageName=com.sourcey.materialloginexample, activityState=resume 01-11 15:04:20.474 31823-31823/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.sourcey.materialloginexample, PID: 31823

java.lang.NullPointerException at com.firebase.ui.auth.twitter.TwitterPromptActivity$1.onPostExecute(TwitterPromptActivity.java:98) at com.firebase.ui.auth.twitter.TwitterPromptActivity$1.onPostExecute(TwitterPromptActivity.java:71) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5692) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) 01-11 15:04:20.484 767-931/? D/PointerIcon: setMouseIconStyle1 pointerType: 1001iconType:101 flag:0

On Mon, Jan 11, 2016 at 2:55 PM, Troy Chuinard tccpg288@gmail.com wrote:

Thanks for filling me in Frank. Definitely new to this process and programming in general. Regardless of how many apps I have and the number of keystore files I generate for Android, do I always only have 1 SHA1 key? I want to make sure that I didn't duplicate those on accident when I created multiple keystore files.

Also, when do you expect the new UI library to be released?

Appreciate the help.

-Troy

On Mon, Jan 11, 2016 at 2:42 PM, Frank van Puffelen < notifications@github.com> wrote:

I enable Google auth regularly using FirebaseUI. But the steps are convoluted indeed. Look for the 0.3.1 release to drastically simplify what you need to do in your Android project. But the steps in the developer console will remain the same: you will need (at least) two OAuth 2.0 client IDs. One of type "Web application" and one of type Android, which matches the package name of your app and SHA1 of the machine where you run the gradle build/Android Studio.

On Mon, Jan 11, 2016 at 12:13 PM troy21688 notifications@github.com wrote:

It also looks like the official Google documentation has different instructions. It does not mention adding the meta-data to the Manifest file, and I am uncertain what key to add to my Strings.xml file. The json file that you have to create has its own key, however the instructions also say to add an Auth 2.0 key for the web server. Very confusing, has anyone actually gotten the Google Sign In to work? Here are the instructions I am following, directly from Google:

https://developers.google.com/identity/sign-in/android/start-integrating

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170675778

.

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170683784 .

Troy Chuinard, CPA

Troy Chuinard, CPA

puf commented 8 years ago

If you think you've found a second issue, open a separate issue for that please.

On Mon, Jan 11, 2016 at 1:05 PM troy21688 notifications@github.com wrote:

Also, not sure if I am doing something wrong, but I am getting an error with the Twitter login as well. Let me know if the Twitter login is being updated in the next release and I will ignore for now:

01-11 15:04:20.474 31823-31823/? D/AndroidRuntime: Shutting down VM 01-11 15:04:20.474 31823-31823/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41819da0) 01-11 15:04:20.474 1181-1181/? D/WfcActivityStateReceiver: onReceive(): packageName=com.sourcey.materialloginexample, activityState=resume 01-11 15:04:20.474 31823-31823/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.sourcey.materialloginexample, PID: 31823

java.lang.NullPointerException at

com.firebase.ui.auth.twitter.TwitterPromptActivity$1.onPostExecute(TwitterPromptActivity.java:98) at

com.firebase.ui.auth.twitter.TwitterPromptActivity$1.onPostExecute(TwitterPromptActivity.java:71) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5692) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at

com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107) at dalvik.system.NativeStart.main(Native Method) 01-11 15:04:20.484 767-931/? D/PointerIcon: setMouseIconStyle1 pointerType: 1001iconType:101 flag:0

On Mon, Jan 11, 2016 at 2:55 PM, Troy Chuinard tccpg288@gmail.com wrote:

Thanks for filling me in Frank. Definitely new to this process and programming in general. Regardless of how many apps I have and the number of keystore files I generate for Android, do I always only have 1 SHA1 key? I want to make sure that I didn't duplicate those on accident when I created multiple keystore files.

Also, when do you expect the new UI library to be released?

Appreciate the help.

-Troy

On Mon, Jan 11, 2016 at 2:42 PM, Frank van Puffelen < notifications@github.com> wrote:

I enable Google auth regularly using FirebaseUI. But the steps are convoluted indeed. Look for the 0.3.1 release to drastically simplify what you need to do in your Android project. But the steps in the developer console will remain the same: you will need (at least) two OAuth 2.0 client IDs. One of type "Web application" and one of type Android, which matches the package name of your app and SHA1 of the machine where you run the gradle build/Android Studio.

On Mon, Jan 11, 2016 at 12:13 PM troy21688 notifications@github.com wrote:

It also looks like the official Google documentation has different instructions. It does not mention adding the meta-data to the Manifest file, and I am uncertain what key to add to my Strings.xml file. The json file that you have to create has its own key, however the instructions also say to add an Auth 2.0 key for the web server. Very confusing, has anyone actually gotten the Google Sign In to work? Here are the instructions I am following, directly from Google:

https://developers.google.com/identity/sign-in/android/start-integrating

— Reply to this email directly or view it on GitHub <

https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170675778

.

— Reply to this email directly or view it on GitHub < https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170683784

.

Troy Chuinard, CPA

Troy Chuinard, CPA

— Reply to this email directly or view it on GitHub https://github.com/firebase/FirebaseUI-Android/issues/56#issuecomment-170689544 .

abeisgoat commented 8 years ago

This appears to be resolved and forked into another issue, closing.

Queskr commented 8 years ago

How/where was it resolved?

hakimrie commented 8 years ago

I got this crash log from crashlytic

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9000, result=0, data=Intent { (has extras) }} to activity {com.hakimlabs.quran/com.quran.labs.androidquran.ui.QuranActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
       at android.app.ActivityThread.deliverResults(ActivityThread.java:3699)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
       at android.app.ActivityThread.-wrap16(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference
       at com.firebase.ui.auth.core.FirebaseLoginDialog.reset(FirebaseLoginDialog.java:97)
       at com.firebase.ui.auth.core.FirebaseLoginBaseActivity.resetFirebaseLoginPrompt(FirebaseLoginBaseActivity.java:100)
       at com.quran.labs.androidquran.ui.QuranActivity.onFirebaseLoginUserError(QuranActivity.java:441)
       at com.firebase.ui.auth.core.FirebaseLoginBaseActivity$1.onUserError(FirebaseLoginBaseActivity.java:123)
       at com.firebase.ui.auth.core.FirebaseLoginDialog$1.onUserError(FirebaseLoginDialog.java:118)
       at com.firebase.ui.auth.google.GoogleAuthProvider.onActivityResult(GoogleAuthProvider.java:111)
       at com.firebase.ui.auth.core.FirebaseLoginDialog.onActivityResult(FirebaseLoginDialog.java:54)
       at com.firebase.ui.auth.core.FirebaseLoginBaseActivity.onActivityResult(FirebaseLoginBaseActivity.java:83)
       at android.app.Activity.dispatchActivityResult(Activity.java:6428)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:3695)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:3742)
       at android.app.ActivityThread.-wrap16(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5417)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
dazza5000 commented 8 years ago

I have the same issue as @hakimrie . Has anyone found a solution?

fdambrosio commented 6 years ago

I have the same problem