First, generate the `.jks` file using this command:
On macOS or Linux, use the following command:
keytool -genkey -v -keystore ~/upload-keystore.jks -keyalg RSA \
-keysize 2048 -validity 10000 -alias upload
On Windows, use the following command in PowerShell:
keytool -genkey -v -keystore $env:USERPROFILE\upload-keystore.jks `
-storetype JKS -keyalg RSA -keysize 2048 -validity 10000 `
-alias upload
If this command doesn't work, it's an environment setup issue. Search Google for a solution. Once you have successfully generated the `upload-keystore.jks` file, copy the file and paste it into this directory: `lms_flutter_app\android\app\cert`. If this directory already contains an `upload-keystore.jks` file, replace it with the newly created one.
Next, go to this directory: `lms_flutter_app\android\key.properties`.
In this file, replace the following lines:
storePassword=123456
keyPassword=123456
replace the number 123456 with the password you used when creating the JKS file. Now, the JKS file configuration is done.
Next, go to this directory: `lms_flutter_app\android\app\build.gradle`. Around line number 89, you will see code similar to this:
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
If you see a line like this: signingConfig signingConfigs.debug
then change it to: signingConfig signingConfigs.release
If it is already set to `signingConfig signingConfigs.release`, then you don’t need to change anything.
Next, open the terminal and navigate to the `lms_flutter_app/android` directory. Then run the following command:
./gradlew signingReport
Look for the Variant: `release` and copy the SHA-1 value.
Go to your Firebase Console, Make sure to enable google sign in on firebase auth provider. Then, open the Project Settings by clicking the gear icon next to "Project Overview".
Go to the "General" tab, scroll down to the "Your apps" section, and select your Android app. Add the SHA-1 key you generated earlier and click Save to update your project settings with the new SHA-1 key.
After that, try logging in again on your app using google sign in method.
Note: In case if google sign in still not working, it is not issue of your code, you can search online or refer to the following solutions and try to fix the issue Stack Overflow link , GitHub issue link