firebase_messaging dependecy consistency with the project - firebase

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

Related

Error building Player: iOS framework addition failed due to a CocoaPods installation failure

I've just updated Firebase in my Unity project to Firebase 10.4.0 and now when I try to build, I get the error below while failing the build.
Error building Player: iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.
After the failure, "pod repo update" was executed and failed. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.
I've checked minimum compatibility with the new version of Firebase and am using what's listed below.
Unity 2021.3.18f1
Cloud Firestore, Firebase App(Core), and Firebase Cloud Messaging 10.4.0
External Dependency Manager for Unity 1.2.175
Cocoapods I've tried versions 1.10.2 and 1.11.3 (started with 1.10.2 when I got the issue, redownloaded 1.10.2 to no avail and then tried 1.11.3, same issue)
Ruby 2.6.10p210
I could be wrong, but it seems like Unity is not detecting my current version of cocoapods, trying to install it, and failing.
Any help is greatly appreciated, I've spent 2 days on this already :/
I've redownloaded cocoapods version 1.10.2 as well as updated to 1.11.3 and the error persists. I've checked dependancies and everything seems to be compatible.
I've looked at other stack overflow posts and nothing has helped with my issue.

Flutter: About changing the version of packages such as flutterfire

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.

Nuget Package Clash on Different Dependency Version

I'm using Xamarin.Forms.Maps and Microsoft.AppCenter.Push in my PCL project. Lately I tried to update my Push to latest version, but it's clashing with the Maps because different version of Xamarin.GooglePlayServices.Base is expected.
Severity Code Description Project File Line Suppression State Error
NU1107 Version conflict detected for Xamarin.GooglePlayServices.Base.
Install/reference Xamarin.GooglePlayServices.Base 71.1610.0 directly
to project XXX.Android to resolve this issue.
XXX.Android -> Microsoft.AppCenter.Push 2.5.0 ->
Xamarin.Firebase.Messaging 71.1740.0 -> Xamarin.Firebase.Iid 71.1710.0
-> Xamarin.Firebase.Iid.Interop 71.1601.0 -> Xamarin.GooglePlayServices.Base (>= 71.1610.0)
XXX.Android -> Xamarin.Forms.Maps 4.3.0.947036 ->
Xamarin.GooglePlayServices.Maps 60.1142.1 ->
Xamarin.GooglePlayServices.Base (= 60.1142.1).
Push is expecting version 71 while Maps is expecting version 60. May I know how to resolve this and I'm curious why cannot the Maps use the later version? Is it not backward compatible?
Thank you.
Yes, I have reproduce this problem as you said.
Accoriding to the error log, we know that the problem is that though the Xamarin.Forms.Maps Nuget have been updated to a newer version, but the package (Xamarin.GooglePlayServices.Base) in this nuget hasn't been updated synchronously to the later version( 71.1610.0). It should be an issue of this Nuget. And we can report it as a bug here: https://github.com/xamarin/Xamarin.Forms/issues
For now, in order to keep the code working properly,what we can do is keep the two Nuget versions in sync.
Just install nuget Microsoft.AppCenter.Push 2.1.1 and nuget Xamarin.Forms.Maps 4.3.0.947036.
EDITED
If you read the comments, there is one saying that you can install dependencies manually.
In this case, by visiting the NuGet repo for Xamarin.Forms.Maps you can see in the dependencies list that it requires Xamarin.GooglePlayServices.Maps.
Just make sure you already have dependencies installed, or simply add them to your Android solution (I added also Xamarin.Android.Support.v7.AppCompat).
By following these steps, I'm able to run both Xamarin.Forms.Maps (v4.4.0.991477) and Microsoft.AppCenter.Push (v2.6.4).
There is an issue on the GitHub relate repo and seems to be fixed.
Refer to following link please
NuGet version conflict between Xamarin.Froms.Maps and Microsoft.AppCenter.Push
You can check the whole evolution of the issue.

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

Resources