My login screen does not load when I start my flutter app - flutter

I don't know the gradle version and plugin to use with firebase authentication. The application runs fine when I load it through the debug mode and the login page shows up. But when I build the release apk the login page does not load up and the screen is blank. I had changed the gradle version from the default once before.
PLUGIN : distributionUrl = https://services.gradle.org/distributions/gradle-6.5.1-all.zip
GRADLE DIST: classpath 'com.android.tools.build:gradle:4.1.0'
Firebase auth version in pubspec : firebase_auth: ^0.18.4+1
this is what I am currently using

I don't think that gradle version is your problem. Basically, flutter's default version is more than fine for firebase packages.
EDIT:
That's my gradle version and firebase_auth is working for me:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
classpath 'com.android.tools.build:gradle:3.5.0'

Related

Flutter issue with Google Ads & Firebase Versions

I am using latest version of flutter 3.7.2
My app has google ads and firebase dependency for which is use following pubs latest versions
admob_flutter:
firebase_messaging:
firebase_core:
Everthing is working perfect but when I have uploaded app on playstore it gives me following error
For solution of above warning i done the change in app level gradle file and following line
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-ads:21.5.0' // this line added for solution
implementation platform('com.google.firebase:firebase-bom:29.3.0')
implementation 'com.google.firebase:firebase-analytics'
}
but after adding above line my firebase stopped working it crash when run app with following error.
NOTE: I have tried flutter clean, reinstall app, flutter pub upgrade
everything is up-to date. Also when i change line implementation
'com.google.android.gms:play-services-ads:21.5.0' to implementation
'com.google.android.gms:play-services-ads:19.2.0' everything is
working perfect
you help me with the part that you say works with only 'com.google.android.gms:play-services-ads:19.2.0' and I had the same problem but trying to solve it by changing this line:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.google.firebase:firebase-ads:21.5.0'
}
you try to change firebase-ads:19.1.0 to 21.5.0 and it will let you use
implementation 'com.google.android.gms:play-services-ads:21.5.0'
It works for me, hope helps you.
If you are using 'admob_flutter' and update to 'com.google.android.gms:play-services-ads:2.50.0' you couldn't use Admob, this is because 'admob_flutter' does not support 'play-services-ads:2.50.0'.
In this case, I used 'google_mobile_ads 2.3.0' it's verified and published by 'google.dev
https://pub.dev/packages/google_mobile_ads

Flutter project can't be build because of plugin Geolocator

Since I have included the geolocator plugin in my flutter project, the build fails with the message
A problem occurred evaluating root project 'android'.
Basedir C:\Users\<user>\flutter\.pub-cache\hosted\pub.dartlang.org\geolocator-8.1.1\android does not exist
It's true that this directory does not exist but that's the way is done in github project.
do you have implement geolocator for a platform like android or ios?
after you have implemented you can try:
run: flutter clean and try again
Make sure your Android project uses gradle version 3.5.0 and gradle-wrapper 5.6.2.

Flutter Web cloud_firestore package: Versions newer than 0.12.11 produces just a blank web page

When I run the command: flutter build web => I get a blank web page. If I use cloud_firestore::0.12.11 OR older, all runs perfectly well.
Steps to reproduce the behavior:
flutter doctor. No issues found.
flutter run -d chrome. The app runs OK on the local browser.
flutter build web. The app runs and shows a blank page.
In pubspec.yaml: remove the dependency cloud_firestore: The app runs OK.
In pubspec.yaml: add the dependency cloud_firestore:0.12.11 (older version), The app runs OK.
Expected behavior
I need to use cloud_firestore: 0.14.0+2 so I can use the data type FirebaseFirestore.
Are you also using other firebase packages? I have found there are issues with firebase_auth - including a black screen.
Make sure you following the Migration Guide: https://firebase.flutter.dev/docs/migration/#plugin-changes
The issue was with a bug in the library itself.

How to use cloud_firestore in flutter for web and android?

I have a Flutter app which works on Android as expected but if I want to compile it for Web I get an error.
It has to do something with the dependency cloud_firestore. If I use the dependency firebase it works fine on the web but on android now not..
This is the error message I get using cloud_firestore (compiling for web):
Skipping compiling pay_balance|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
firebase_core|lib/firebase_core.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Can anybody help me? Maybe with another dependency for firestore (I did not find others which are working on web and android)..
Edit: I have used the firebase-dart plugin for web!! -> Only works on the web but not in android for me -> I need something for both at the same time!!
Or is there a Way I can use both packages without getting a compling error for the web when I import cloud_firestore?
If you want to use Firebase on Web and Mobile you have to get creative. I created the fb_auth plugin that uses the Mobile SDK firebase_auth on iOS and Android and the firebase package on web. This will give you a single plugin for auth.
https://pub.dev/packages/fb_auth
Im working on firstore and storage but they are not ready yet.
I have also created an article on how to do this with flutter:
https://medium.com/#rody.davis.jr/how-to-build-a-native-cross-platform-project-with-flutter-372b9e4b504f
You have to use dynamic imports so that at compile time it tree shakes what it doesn't need and will not throw an error.
Currently this is the only way to officially use both plugins in the same project.
EDIT: cloud_firestore now added
Two of the FutterFire plugins are now supported for web. FlutterFire plugins supporting web firebase_auth and firebase_core
cloud_firestore is now also supported

Google Login + FCM together in an Ionic 2 project

I am using Ionic2 framework and my app requires Google Login and fcm to receive notifications.
I first integrated the Google Social Login using google plus native plugin and it was working perfectly fine. Then, on adding fcm I received following errors:
Found com.google.android.gms:play-services-location:11.+, but version 9.0.0 is needed for the google-services plugin.
Found com.google.android.gms:play-services-auth:11.8.0, but version 9.0.0 is needed for the google-services plugin.
Found com.google.android.gms:play-services-identity:11.8.0, but version 9.0.0 is needed for the google-services plugin.
:processArmv7DebugGoogleServices
FAILED
Because of the version conflict, I upgraded it to 9.0.0 and fcm is working fine now but the Google Login seems to have stopped working. I am receiving not even an error. The function leads to nothing.
Can anyone tell me a way to integrate Google Login + FCM together in an Ionic 2 project?
try to change this file under fcm plugin directory
/plugins/cordova-plugin-fcm/src/android/FCMPlugin.gradle
buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:3.0.0'
}
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
// apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}
Then
ionic cordova platform rm android
ionic cordova platform add android
then change this file
/platforms/android/project.properties (removing + with 11.4.2)
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.system.library.1=com.facebook.android:facebook-android-sdk:4.+
cordova.system.library.2=com.google.firebase:firebase-core:11.4.2
cordova.system.library.3=com.google.firebase:firebase-messaging:11.4.2
cordova.gradle.include.1=cordova-plugin-fcm/mobile-FCMPlugin.gradle
cordova.system.library.4=com.google.android.gms:play-services-auth:11.4.2
cordova.system.library.5=com.google.android.gms:play-services-identity:11.4.2
cordova.system.library.6=com.android.support:support-v4:24.1.1+
cordova.gradle.include.2=cordova-support-google-services/mobile-build.gradle
cordova.gradle.include.3=twitter-connect-plugin/mobile-twitter.gradle
cordova.system.library.7=com.squareup.okhttp3:okhttp:3+
Then build
ionic cordova build android