Closed PaulZhangIsing closed 6 years ago
@PaulZhangIsing Thanks for opening the issue. Can you please double check your imports on top of your Java
file. Can you please check if by mistake you've imported com.google.android.gms.common.SignInButton
instead of com.shobhitpuri.custombuttons.GoogleSignInButton
?
Thanks I think I could close this issue. Thanks for the help!!!!!
The GoogleSignInButton can't work with the default SignInButton. why is this?
@Julius26 Thanks for the comment. Can you please explain a bit? When you say that 'can't work', do you mean that GoogleSignInButton
cannot be casted to SignInButton
. This is because if you see the custom GoogleSignInButton implementation, its parent is AppCompatButton
and SignInButton parent is FrameLayout
. If you want to cast, both can be casted as View
for the time being, since they all extend the View
class at the end. Hope this answers your query. If not, please feel free to expand on your question. Thanks!
Hi @shobhitpuri my app keeps crashing and I double checked all the corrections you mentioned above but it still won't work. This is the error I am getting Caused by: java.lang.ClassCastException: com.shobhitpuri.custombuttons.GoogleSignInButton cannot be cast to com.google.android.gms.common.SignInButton
Could you please guide me to the solution? Much appreaciated
@rupakyeware Can you see if below is the issue, else please share the stacktrace and relevant file to help debug further.
@PaulZhangIsing Thanks for opening the issue. Can you please double check your imports on top of your
Java
file. Can you please check if by mistake you've importedcom.google.android.gms.common.SignInButton
instead ofcom.shobhitpuri.custombuttons.GoogleSignInButton
?
I have followed instructions on the mainpage , imported the packages did adjustments to xml file. Then I have do such things in my java file
view.findViewById(R.id.sign_in_button).setOnClickListener(this); SignInButton signInButton = (SignInButton) view.findViewById(R.id.sign_in_button); signInButton.setSize(SignInButton.SIZE_STANDARD); signInButton.setColorScheme(SignInButton.COLOR_LIGHT); }
then it give me error by the time I wanna open the page contains this google login button
com.shobhitpuri.custombuttons.GoogleSignInButton cannot be cast to com.google.android.gms.common.SignInButton