davidmartos96 / sqflite_sqlcipher

SQLite flutter plugin
BSD 2-Clause "Simplified" License
99 stars 44 forks source link

The lower bound of "sdk: '>=2.4.0-dev <3.0.0'" must be 2.12.0 or higher to enable null safety. #93

Closed chunsfire closed 4 months ago

chunsfire commented 4 months ago

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
davidmartos96 commented 4 months ago

@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 commented 4 months ago

pubspec.txt

davidmartos96 commented 4 months ago

@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
chunsfire commented 4 months ago

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.

davidmartos96 commented 4 months ago

@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

chunsfire commented 4 months ago

Got it.. For me, I need to point to my repo, so I'll omit the ref. Thanks @davidmartos96 for looking into this issue.