Firebase SPM brings lots of Warning under iOS15 - swift

Using XCode13.1, iOS15.1, Swift5.5.1 :
The Swift Package Manager is great and it improved again under iOS15.
However, my observation is that even big companies do not fully embrace its usage.
One painful experience at the moment is: Google Firebase integration with SPM.
It is mostly their sub-dependencies that cause lots of Warning messages inside Xcode.
Google Firebase 8.9.1 integration with Swift Package Manager uses the following two sub-dependencies :
abseil 0.20200225.3
BoringSSL-GRPC 0.7.1
others...
In the Project Navigator of Xcode you can immediately see the Warning-Signs.
When compiling my project there are 37 Warnings due to the two above sub-dependencies of Firebase. The compiler prints the following warnings:
What is there to do ?
When is Google updating their Firebase dependencies appropriate for iOS15 ?

In Xcode, do File -> Packages -> Update to latest Package Versions to get the fixes in abseil 0.202200225.4, BoringSSL-GRPC 0.7.2, etc.

Related

Error in resolving package dependency swiftUI project

Dependencies could not be resolved because root depends on 'googleappmeasurement' 9.0.0.
'googleappmeasurement' 9.0.0 cannot be used because 'googleappmeasurement' 9.0.0 depends on 'nanopb' 2.30908.0..<2.30909.0 and root depends on 'nanopb' 2.30909.0..<2.30910.0.
that is my error message, can anyone help?
I am using SDK version 8.9.1 and everything working fine, If you executed the Resolve Package Versions and still not working. you can try the command Reset Package Caches from Project navigator scroll down right click on Package Dependencies then choose the command. that will clear all caches for all installed packages then re-install them again. if that not working i suggest you to use version 8.9.1 till Firebase fix the issue.
I have discovered the problem has been answered here. It occurs when importing Firebase using Swift Package Manager and setting to track "master" instead of a specific release version.
Got same error and solved, check attached image, this most likely packages usage misconfiguration, as follows:
1-perhaps you are working on a branch with different Xcode version than the other developer who installed the package.
2-Perhaps some package is conflicted being used twice, by so some dependencies are duplicated.
Well to solve this you gotta try either to match the Xcode version used while installing the packages, or to remove the package that makes errors(like Firebase here), and try adding that package again your side.

Flutter | Error: Couldn't resolve the package

I created a package that is a collection of my own helper classes for faster developing...
The package also included firebase_analytics: which requires a native implementation for each platform i want it to run. Even if i dont wanted to use firebase at all, but still wanted to use my package i was forced to create firebase-config files for the app, because the app crashes if the firebase_analytics package does not find a valid file for the specific platform. To avoid those things i splitted my package in two packages.
The Core-Package: All helper classes that run native dart code
Optional extension: Only the classes that need the firebase implementation
So if i want to use the package without firebase i just have to depend on the core.
If i want to use the firebase variant i could simply depend the firebase package, because the extension package itself depends on the core-package in its own pubspec.yaml file.
PROBLEM: Since i restructured my package like i described, all my apps that depend on it are not building anymore. The console says that all packages that i depend on in my two packages can not be found. This error occures both ways: With firebase & without.
ERROR: (Scroll down for the complete console output)
MY ATTEMPTS:
"flutter clean" & "flutter pub get" in every package and app folder
"flutter pub cache repair"
CORE-PACKAGE Pubspec.yaml:
FIREBASE-Extension Pubspec.yaml:
Plain Console Output:
pastebin.com/m14cbqDV
Thanks for any help!!
I am facing the same issue while i was making a build in Xcode 13.So I had upgraded my flutter version 2.8.0 to 2.10.2 and also removed the version of all firebase dependencies, then the issue was finally solved.
I have faced similar issues and resolved them by removing package versions. Issues like this often arise due to mismatched versions of packages (eg firebase_core, firebase analytics). Please try to remove versions of the firebase packages or the whole packages. (like firebase_analytics :).
Sorry, my bad! As you can see i moved my dependencys to the dev section of my pubspec.yaml. They should be placed in the dependency section.

Illegal Instruction 4 error while running the unit tests on Xcode

I recently updated to Xcode 12.3 and did the workaround to run the carthage dependencies. The build is fine but when I run the tests, I get the Illegal Instruction 4 error. I assume that the arm architecture issue causes that issue. I use Quick and Nimble coming from carthage and these are used in testing. I have tried setting the excluding archs and validate archs to yes but none of them worked.
I cannot move the libraries from carthage to pods or spm because there are so many configurations in the libraries. Updating to a new Xcode version is such a pain especially if you are using carthage.
UPDATE:
I downloaded the carthage version of 0.37 and implemented the xcframeworks into the project. To run the dependencies for xcframeworks, I run the following command:
carthage bootstrap --use-xcframeworks --no-use-binaries --platform ios
If you can use Carthage 0.37.0 and are able to use XCFrameworks, then this answer might be valuable for you 👍 In this vesion they added support for XCFrameworks and I find it quite nice to use. Especially since this popular workaround can finally be removed again.

Bluemix Swift Mobile Client Access SDK when imported says no such module BMS Core and BMS Analytics show 35 errors due to which my build fails

As per the instructions given on Bluemix site; I installed the Swift SDK
pod use_frameworks!
pod 'BMSSecurity'
and it shows this on my terminal:
Then, when I built the project, I got 36 build errors.
First of which is "no such module as BMSCore" when I can see that framework imported in the pod and 35 errors related to BMSAnalytics, which is again framework imported.
These build errors are due to the incompatibility between two of the BMSSecurity dependencies (BMSCore and BMSAnalyticsAPI) and the version of Xcode you are using (7.2.1). The latest versions of these 2 frameworks only support Xcode 7.3 and higher, as explained in the BMSCore Github README. If you want to continue using Xcode 7.2, you can use BMSCore 1.0.3 instead.
So, there are 2 possible solutions here:
Upgrade Xcode to version 7.3
Add the following line to your Podfile: pod 'BMSCore', '~> 1.0.3'
Option 1 is recommended since only Xcode 7.3+ will be supported in future releases of BMSSecurity.
Are you opening FoodTracker.xcworkspace ?? please open .xcworkspace after pod install..

Carthage + Quick framework + Swift 2 = "error: module file was created by an older version of the compiler; rebuild 'Quick' and try again"

I'm using Xcode 7 beta 5 (it's the only xcode currently installed) with Swift 2 and when I try to run unit tests with Quick, I get the following error:
error: module file was created by an older version of the compiler; rebuild 'Quick' and try again
I'm using Carthage (0.8.0) to manage my dependencies. My Cartfile.private has:
github "Quick/Quick" ~> 0.5.0
github "Quick/Nimble" "v2.0.0-rc.2"
As far as I know, these are the Swift 2 versions of these libraries. I have the libraries linked and when I try to run the unit tests, I get the noted error.
There's a similar question here but that doesn't seem like my problem
Realm: Module was created by an older version of compiler and could not build objective-c module
I've cleaned out my DerivedData and Carthage/Build folders and still no luck.
How can I run unit tests with Swift 2 and Quick?
It may be related to the following kind of problem if you updated from another beta version : https://github.com/neonichu/xcode-install/issues/48
xcode-install uses ditto to install Xcode, which merges files from the source into existing directories at the destination path.
If a new (beta) version of Xcode doesn't contain files which were present in the previous version, the old files will still be there after installing the update.
Try uninstalling and reinstalling Xcode.