The lower bound of "sdk: '>=2.4.0-dev <3.0.0'" must be 2.12.0 or higher to enable null safety.
chunsfire opened this issue · 6 comments
Getting below error;
The current Dart SDK version is 3.4.0.
Because firstapp depends on sqflite_sqlcipher_repo from git which doesn't support null safety, version solving failed.
The lower bound of "sdk: '>=2.4.0-dev <3.0.0'" must be 2.12.0 or higher to enable null safety.
For details, see https://dart.dev/null-safety
@chunsfire It looks like you are depending on the package with a git dependency.
Could you post how your pubspec.yaml looks like?
Note that the root pubspec.yaml in the repo is not the one you are looking for, but the one inside the folder sqflite.
@chunsfire The path you are using in the git dependency is the problem.
If you have your own reasons for not using pub.dev versioning, note that the way you have it will be pulling latest master on each of your dependencies, which can break unexpectedly. You can add ref: <some commit hash/branch name/tag>
you are interested in.
But managing your dependencies via pub would be definitely easier.
With git dependencies try the following. It should fix the other issue you opened too.
sqflite_sqlcipher:
git:
url: git@testhost:fmw-idm-cloud/flutter-packages.git
path: packages/sqflite_sqlcipher/sqflite
ref: v3.1.0
thanks for suggesting the fix.
If I am giving "ref", its throwing an error;
Because firstapp depends on sqflite_sqlcipher from git which doesn't exist (Could not find git ref 'v3.1.0' (fatal: ambiguous argument 'v3.1.0': unknown revision or path not in the working tree.
While w/o that it's able to resolve the dependency correctly. And yes the version is now coming correctly.
@chunsfire That's because the git url you are using is not pointing to this repository.
You could use this url instead
https://github.com/davidmartos96/sqflite_sqlcipher
Got it..
For me, I need to point to my repo, so I'll omit the ref.
Thanks @davidmartos96 for looking into this issue.