I'm currently working on a project that uses Cocoapods in Flutter 2.2.3 and I'm having Issues with the Flutter pod that in included when I run pod install. The version it is giving me is Flutter 1.0.0, even though I'm building the app using flutter 2.2.3.
This is the output I get from running pod outdated:
Updating spec repo `trunk`
Analyzing dependencies
The color indicates what happens when you run `pod update`
<green> - Will be updated to the newest version
<blue> - Will be updated, but not to the newest version because of specified version in Podfile
<red> - Will not be updated because of specified version in Podfile
The following pod updates are available:
- Firebase 8.3.0 -> (unused) (latest version 8.4.0)
- FirebaseCore 8.3.0 -> 8.3.0 (latest version 8.4.0)
- Flutter 1.0.0 -> 1.0.0 (latest version 2.0.2)
This begs the question, is the Flutter pod equivalent and/or overriding the Flutter SDK? I don't think it is but I haven't been able to find any concrete explanation of what the difference between the two are. I tried looking up the Flutter pod on the cocoapods website but the description did not prove helpful at all.
I was wondering the same and came across this issue: https://github.com/flutter/flutter/issues/53673
It looks like this is to be expected and doesn't really matter:
This is expected. The Flutter framework isn't downloaded from CocoaPods; it's copied from your installed Flutter SDK. So it's hard-coded to 1.0 since there's no version resolution for CocoaPods to handle. If you see actual issues related to this, pleas let us know!
Rather confusing given that CocoaPods shows you there's a newer version.
Related
Does objectbox flutter support ios emulator on M1 macbooks?
I get this error despite following Getting started guide, however it works fine in CI which also runs on M1 chip (but against physical phone engine snapshot, not the emulator)
$ pod install
Analyzing dependencies
[!] CocoaPods could not find compatible versions for pod "ObjectBox":
In snapshot (Podfile.lock):
ObjectBox (= 1.7.0)
In Podfile:
objectbox_flutter_libs (from `.symlinks/plugins/objectbox_flutter_libs/ios`) was resolved to 0.0.1, which depends on
ObjectBox (= 1.8.1)
Specs satisfying the `ObjectBox (= 1.7.0), ObjectBox (= 1.8.1)` dependency were found, but they required a higher minimum deployment target.
From what I can see, 1.7.2 requires swift 5.7.2 which according to a quick google search should be supported by ios 14
I've tried rolling back to 1.6.2 and changing deployment target up to 14 (from 11) but the error is still there.
How do I fix that?
I deleted Podfile.lock and then ran flutter pub get followed by pod install which seems to have solved the issue
[!] CocoaPods could not find compatible versions for pod "Sentry":
In Podfile:
sentry_flutter (from .symlinks/plugins/sentry_flutter/ios) was resolved to 0.0.1, which depends on
Sentry (~> 7.11.0)
None of your spec sources contain a spec satisfying the dependency: `Sentry (~> 7.11.0)`.
I am just trying to install sentry_flutter plugin in my futter project. Currently i am testing in ios device. But it gives the above error.
The error message seems straight forward enough. But i cannot manage to include this plugin in my project.
you can run pod repo update to update your local cache bcause it may be outdated.
If it doesn't fix the issue for you, you can delete your Podfile.look file on ios folder and run pod install
We have decided to upgrade the Flutter version from 1.22 to 2.0 (migrating to null-safety) in an existing project.
We checkout Flutter v2.0.0 and then run the following command:
dart pub upgrade --null-safety
Flutter nicely resolves all dependency conflicts and sets new versions for packages.
Without changing min environment SDK in pubspec.yaml (staying at ">2.10.0 <3.0.0") we fix all breaking changes in the code.
All errors in vs code disappear so we can compile the code. But, when we do compile we get errors from packages e.g. reorderables, fl_chart, flutter_svg etc. stating some classes are undefined. It seems like packages were compiled with a higher SDK version and they weren't set min SDK version to match the one that they were compiled with.
So the package states it can be compiled with Flutter 2.10.0 but in reality, it fails to compile because in this version of Flutter it is missing some necessary imports.
My question is, is this a problem of packages or a problem in my way of processing with migration?
Is it that packages are lacking properly set min SDK?
My conclusion is that most packages are lacking correctly set SDK version constraints. It seems authors usually compile packages for a certain version and do not check min SDK version required. When running dependency resolver it seems to solve dependencies but in compile time it fails.
I am building a basic app using flutter, in which I had to use provider, I added Provider dependencies in pubspec.yaml file but getting this error please help, I added the error below not able to fix this problem I have the latest flutter SDK
To solve this use lower version of Provider dependency as newer version of provider depends on newer version of Flutter SDK and your application's Flutter SDK is old one so it will have compatibility issues, So just degrade the version of dependency or you can also run pub outdated command and it will suggest you compatible version as per your SDK.
What version does flutter fetch when I add plugin dependency like below code:
dependencies:
pluginA: ^0.1.8
If available versions are 0.1.8+1, 0.1.9, 0.2.0 etc.
As I see version ^2.1.3 and '>=2.1.3 < 3.0.0' are equal, but except for the prerelease version.
(checked from this link)
So does flutter fetch the updated patch version of pluginA, or fetch the exact version in my case?
I found my answer, here flutter will fetch the latest patch version of pluginA, and in my case, it is 0.1.9.
It is similar to:
pluginA: '>=0.1.8 < 0.2.0'