Browser blocked autoplay.
Resolving the Code 10 Error in Google SignIn API for Android Apps
Encountering the Google SignIn API `Code 10` error on a new machine? This guide provides a step-by-step guide to resolve the issue by adding the correct SHA Key in your Firebase project settings.
---
This video is based on the question https://stackoverflow.com/q/62937559/ asked by the user 'imin' ( https://stackoverflow.com/u/301584/ ) and on the answer https://stackoverflow.com/a/62937910/ provided by the user 'Taki' ( https://stackoverflow.com/u/9773423/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.
Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Google SignIn API Exception 10 when compile on another computer
Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/licensing
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/by-sa/4.0/ ) license.
If anything seems off to you, please feel free to write me at vlogize [AT] gmail [DOT] com.
---
Resolving the Code 10 Error in Google SignIn API for Android Apps
If you’re developing an Android application that utilizes the Google SignIn API, you might run into the frustrating Code 10 error when compiling your project on a different machine. This issue can emerge from a variety of misconfigurations, particularly related to the security certificates that Google uses to authenticate the application. Let's dive into understanding why this issue occurs and how to resolve it effectively.
Understanding the Problem
The Code 10 error in the Google SignIn API is typically encountered when there is a mismatch in the SHA-1 certificate fingerprint between your application and the registered configuration on Google’s developer console. This usually happens if you are working on a new machine where the SHA-1 key hasn't been registered yet or when there are discrepancies in the setup.
Common Symptoms
Successful login on one machine but failures on another.
Console error messages indicating ApiException: 10.
Example Error Output
For reference, here’s an excerpt from the error log you might see:
[[See Video to Reveal this Text or Code Snippet]]
How to Fix the Code 10 Error
Step 1: Retrieve Your SHA-1 Key
To fix the issue, you need to ensure that the SHA-1 certificate fingerprint from your new machine is acknowledged by your Firebase project. Here’s how you can find it:
Build your app:
Generate a new APK or use the command:
[[See Video to Reveal this Text or Code Snippet]]
Locate the SHA-1:
Look for the SHA-1 key under the variant of your app on the console log.
Step 2: Update Your Firebase Project
Once you have the correct SHA-1 key, follow these steps to add it to your Firebase configuration:
Log in to Firebase Console:
Navigate to your Firebase project.
Access Project Overview:
Click on the settings icon (⚙️) next to "Project Overview" in the sidebar.
Go to Project Settings:
Select the "General" tab in the Project Settings.
Add Your SHA Key:
Scroll down to the section under your package name.
Look for the option to add a new SHA-1 key and input the one you retrieved earlier.
Step 3: Verify google-services.json
Make sure that the google-services.json file is correctly placed in the app folder of your project on both machines. If you have made changes in Firebase, consider downloading the latest google-services.json to ensure all configurations are up to date.
Conclusion
By following the steps outlined above, you should be able to resolve the Code 10 error and successfully run your Google SignIn implementation on any machine. Remember that every time you compile your app on a new device, you must ensure that the SHA-1 key is properly registered in your Google developer console through Firebase. This small step can save a lot of debugging time and frustration!
If you continue facing issues or have further questions, don’t hesitate to reach out in the comments. Happy coding!
About This Video
Viewer's Guide
Published 10 months ago, "Resolving the Code 10 Error in Google SignIn API for Android Apps" is a people & blogs video created by vlogize. Running 1 minute 42 seconds, it has accumulated 271 views on YouTube.
TrendVidStream features this video as part of our global collection of popular YouTube content. For more videos like this, visit our People & Blogs category. You can also browse the vlogize channel for related uploads.
About People & Blogs on TrendVidStream
Vlogs and personal content offer authentic glimpses into creators' lives, perspectives, and experiences. This category showcases diverse voices and stories from around the world, building communities around shared interests and genuine human connection. Browse our full People & Blogs collection to discover more trending videos in this category.
All videos on TrendVidStream are sourced from YouTube using the YouTube API. We curate trending and popular content across multiple regions and categories to help you discover the best videos. TrendVidStream does not host any video content — all videos are streamed directly from YouTube. Read our Editorial Policy to learn more about how we select and organize content.