You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
change package name and add multiDexEnabled true in android/app/build.gradle
get sha1 key from your machine keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android and key is 23:6F:6F:D5:72:F2:D9:C7:30:7A:D9:8F:F9:07:3D:97:36:60:70:63
create a new android app in firebase and follow the steps
download google-services.json and paste it in android/app folder
for sign in code, you will just need web client id from firebase Authentication > Sign in method > Google Web SDK Configuration tab and add it in GoogleSignIn() object
final googleSignIn = gsignin.GoogleSignIn(
clientId:'xxx.apps.googleusercontent.com',
scopes:<String>['email'],
);
error 1 : "FirebaseOptions cannot be null when creating the default app."
to solve this, go to firebase console and add web app and copy the config code and pass it as FirebaseOptions in main.dart
voidmain() async {
WidgetsFlutterBinding.ensureInitialized();
// to avoid duplicate app name exists error - // in earlier versions we used to initiliaze firebase in web.htmlif (kIsWeb) {
awaitFirebase.initializeApp(options:constFirebaseOptions(...));
} else {
awaitFirebase.initializeApp();
}
runApp(constMyApp());
}
Now to add that host 59688 to the gcp project console
go to console.developers.google.com and Select your project (if you cant see your firebase project, search it in the search bar. DONT CREATE A NEW PROJECT).
go to APIs & Services > Credentials > OAuth 2.0 Client IDs > Web client (auto created by firebase) > Authorized JavaScript origins and add http://localhost:59688
if there are multiple entries, then open them all and match the web client id and token with firebase Authentication Google web client id and token
firebase web
firebase init and select hosting
What do you want to use as your public directory? build/web
Configure as a single-page app (rewrite all urls to /index.html)? No
Set up automatic builds and deploys with GitHub? No
change title in html file and yaml file
change favicon in web folder, and replace icons files in web/icons folder
change version before deploying flutter_service_worker.js?v= in index.html
flutter build web to build the app
firebase deploy to deploy the app
app changing title and icons
Steps to change app name in Android:
Navigate to the android>app> src>main and open the AndroidManifest.xml file.
Under the application tag, Find the android:label and replace its value with the new app name.
now run flutter pub get && flutter pub run flutter_launcher_icons:main and it will generate icons for you
do flutter build apk and verify
Version Control
Change the version in yaml file and in app/build.gradle file
if mandatory update, then only change in version.code and firebase
Change Version.code class variable (create a class and put the same version code for easy access)
For web, Change the version code in web/index.html file
SIGNING APP
GENERATING KEYSTORE : copy keystore command to generate keyfile.jks from here or use this command keytool -genkey -v -keystore ~/<appname>-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
store the passwords you enter, you will need it later.
KEYSTORE SHAs : now get the keystore SHA keys from Machine, keytool -list -v -keystore ~/<appname>-key.jks -alias {alias_name i.e. upload} and for password enter keyPassword.
PLAY CONSOLE SHAs : After releasing your app on to the play store, copy the SHA keys from App integrity section
Add these SHA keys in your firebase
create a file, android/key.properties and these lines
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=upload // notice from step 3 keyalias is "upload"
storeFile=<location of the key store file, such as /Users/<user name>/upload-keystore.jks>
In android/app/build.gradle, change your applicationId if you havent already, and for version number change it from .yaml
Add the keystore information from your properties file before the android {} block:
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
...
}