Flutter: About changing the version of packages such as flutterfire - firebase

I am making an application with flutter and firebase.
Regarding packages (libraries),
I heard that various flutterfire packages have been upgraded recently.
For flutter I think that package management is done by listing the package names we want to install in the pubspec.yaml file.
What should I do when the package is updated?
In the upper right corner of the screen
pub upgrade
There is a link saying, but it seems that pressing this does not change the version of each package to the latest version.
Do I have to regularly check for updates myself and manually rewrite this?
pub upgrade
What is the function in the end?
Where should I look to find out?
Another question. At the moment, the firebase_storage package of the pubspec.yaml file is described as follows.
firebase_storage:
git:
url: git://github.com/danysz/flutterfire.git
ref: master
path: packages/firebase_storage
In order to use the method "listAll" to get all the data of firebase_storage like this
I've been taught how to write it on another site before.
When I update other packages of flutterfire in pubspec.yaml file,
pub get
When I do, I get an error in the firebase_storage part.
However, if I specify the latest version of firebase_storage as below, the listAll method cannot be used.
firebase_storage: ^4.0.0
After all, if I do not update the package in the pubspec.yaml file,
the app works at the moment (all can be obtained by the "listAll" method),
But I don't think there is an option to never update the pubspec.yaml file at all.
How can I get the package version up to date and use the listAll method?

listAll method is still not added to the firebase_storage plugin, therefore even if you upgrade to firebase_storage 4.0.0 you can't use listAll.
The following url https://github.com/danysz/flutterfire, is the repository of the person who implemented listAll, but the pull request is still not merged. You can follow it here:
https://github.com/FirebaseExtended/flutterfire/pull/232
Therefore if you want to use listAll then keep using the same versions of the other firebase products and keep using the above url.
Regarding updating plugins:
To upgrade to a new version of the package, for example to use new features in that package, run flutter pub upgrade (Upgrade dependencies in IntelliJ or Android Studio) to retrieve the highest available version of the package that is allowed by the version constraint specified in pubspec.yaml. Note that this is a different command from flutter upgrade or flutter update-packages, which both update Flutter itself.

Related

firebase_messaging dependecy consistency with the project

I have some questions and I would love to get answers because it's the first time that I develop using Flutter and Google services.
So I've been following a course on Udemy and it was created in 2020 but never updated and now after developping the half of the project I've faced a problem with Firebase Messaging, in the course the used version was 7.0.3 and now the latest version is 9.1.4 and a lot has changed.
I tried to install the 7.0.3 version but it didn't work !
Can you suggest any solution because as I said I'm a beginner and even by following some documentations, I find myself stuck and thanks in advance.
Looks like your dependencies are not compatible.
To solve this, you need to use compatible versions of firebase_core and firebase_messaging.
Your firebase_core version is 1.1.0 and the corresponding firebase_messagingversion is 9.1.3 as shown below, so you should use 9.1.3 to remove the error.
// pubspec.yaml of the firebase_messaging plugin
name: firebase_messaging
// ...
repository: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_messaging/firebase_messaging
version: 9.1.3
// ...
dependencies:
firebase_core: ^1.1.0
//...
Source

Why won't the Firebase package install for my Flutter app when I meet the minimum version?

I am using Dart and Flutter to build a mobile app, and I'm trying to import and use outside packages (such as Firebase in this case). I followed this dart page to install it (with the exception of changing pub get to flutter packages get) I get the following message:
The current Dart SDK version is 2.0.0-dev.58.0.flutter-f981f09760.
Because myapp depends on firebase >=4.5.1 which requires SDK version >=2.0.0-dev.61 <3.0.0, version solving failed.
pub get failed (1)
To make sure I have to most recent version, I followed this (mac tab) and did
`$ brew upgrade dart --devel --force`
and got
`dart-lang/dart/dart 2.0.0-dev.69.5 already installed`
So it says I need version 2.0.0-dev.61 or higher, but it also says that I have 2.0.0-dev.69.5 installed. It seems to me that I meet the requirement and that it should work fine, so what am I missing?

Firestore is failed to build with Flutter for iOS

I want to add Firestore to Flutter app, and I have problems running it on iOS.
I already added this line to pubspec.yaml
cloud_firestore: ^0.6.3
Flutter is updated. Flutter doctor says that I have v0.3.1.
While compiling app for iOS simulator I got this build error
Xcode's output: ↳ /
Users/*********/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.3/ios/Classes/FirebaseCorePlugin.m:7:9:
fatal error: 'Firebase/Firebase.h' file not found
#import <Firebase/Firebase.h>
^~~~~~~~~~~~~~~~~~~~~
1 error generated
I also run pod update to make sure that it is not issue with cocoapods.
UPDATE
After another research I found that deleting #use_frameworks! from Podfile in iOS folder let's project to compile. But what should be done in case when this can't be deleted?
The update to this gives me enough information to diagnose (hopefully). Flutter wasn't very good at supporting #use_frameworks & swift, but that was fixed fairly recently (mid-april 2018). However, it may not have made it to the beta channel yet at time of writing.
What was going on when #use_frameworks was set previously is that it wasn't linking everything into the right libraries, and a cocoapods bug was stopping it from finding certain files. The newest version of everything uses dynamic linking but has static_framework=true in the podfile for dependencies with static dependencies so that everything they need actually get linked into the right place.
This is fixed & tested on the master branch/channel, but should probably have made it to the dev branch/channel by now.
Here's the steps to makes sure your environment will support the fix, from this other github issue:
make sure you have Cocoapods 1.5.0 installed (pod --version should
say >= 1.5.0)
change any dependencies you have on the firebase_xxx, google_sign_in, or cloud_firestore plugins to the newest versions
(look for changelog entries referring to Cocoapods 1.5.0)
change your ios/Podfile to the newest version on Flutter master branch
(https://github.com/flutter/flutter/tree/master/packages/flutter_tools/templates/cocoapods)
delete ios/Podfile.lock and ios/Pods
switch to Flutter master (or dev) branch using flutter channel <branch>
flutter clean ; flutter run

Cloud Functions for Firebase - functions.database.instance (and InstanceBuilder) not found

I'm trying to add listeners in my cloud functions to a second database instance according to the documentation here using:
exports.myHandler = functions.database.instance('foo').ref('bar')...
I am getting an error that the functions.database.instance() function doesn't exist. I have updated my functions using npm upgrade and firebase-functions specifically using npm install --save firebase-functions. I still don't see any reference to InstanceBuilder or functions.database.instance() in the source code. Has this functionality actually been released? Am I missing something?
I updated the dependencies in package.json to use the latest versions of firebase-admin and firebase-functions, and it's fixed.

Meteor 0.9.x Update

How do I find out what is holding my app up from updating? I keep getting the 'This project is at the latest release which is compatible with your current package constraints.' message.
Here is the output from the update command:
Refreshing package metadata. This may take a moment.
Figuring out the best package versions to use. This may take a moment.
Figuring out the best package versions to use. This may take a moment.
Figuring out the best package versions to use. This may take a moment.
This project is at the latest release which is compatible with your
current package constraints.
My packages.js looks like so:
# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
accounts-base
accounts-password
alanning:roles#=1.2.9
arunoda:npm#0.2.6
ch-activity
ch-activityreport
ch-arrestreport
ch-assetreport
ch-citation
ch-fieldinterviewreport
ch-incidentreport
ch-inspectionreport
ch-location
ch-media
ch-narrative
ch-organization
ch-person
ch-property
ch-signature
ch-vehicle
cmather:iron-router#0.8.2
coffeescript
copleykj:mesosphere#0.1.9
d3
dash-patrol
email
less
mizzao:bootboxjs#4.2.1-master.1
mrt:accounts-ui-bootstrap-3#=0.3.3
mrt:leaflet#0.3.8
mrt:mongo-counter#1.1.0
notices
sacha:spin#2.0.4
standard-app-packages
tsega:bootstrap3-datetimepicker#=0.2.0
I have migrated all the ch-* and dash-* packages to the new format. Those are local, in app, packages. Those cannot be in public repositories.
Try replacing
cmather:iron-router#0.8.2
with
iron:router#0.9.1
in your packages file.
I'm think it may be because not all your packages are compatible with Meteor 0.9.0
If you want to check what packages are currently compatible enter this code:
meteor search (Package Name)
By default meteor will only return compatible packages, so you can find which packages aren't working by searching each one. If you can't find the package, then its probably not compatible and you aren't going to be able to run the latest version of Meteor unless you remove it.
Don't worry though! While Meteor 0.9.0 is quite buggy, they are working hard to update all the packages and patch the bugs. Just give it a few weeks to sort itself out if that doesn't work :)
Best Of Luck! Hope This Helped!
Meteor search is included in the latest release. Docs: http://docs.meteor.com/#meteorsearch
Try running this command and you should be able to access meteor search
meteor update
Also, the update should tell you if there's a package update available, although I had to run update (packagename) on each starred package for it to update
meteor update aldeed:collection2
I found that I had to remove my ~/.npm directory and run meteor again to resolve some npm dependencies I had. Perhaps you have some npm dependencies as well?

Resources