Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve all the sdk and dependencies issues after cloning a project that was using old sdk and packages?

I have cloned hackernews project that is being developed by google devs in their flutter boring show series on youtube. On running flutter run I am getting these errors.


The current Dart SDK version is 2.9.2.                                  
                                                                        
    Because no versions of test match >1.13.0 <1.14.0 and test >=1.16.0-nullsafety requires SDK version >=2.10.0-0 <2.10.0, test >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety is forbidden.
(1) So, because test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0 and test >=1.12.0 <1.13.0 depends on test_api 0.2.14, test >=1.3.0 <1.13.0-∞ or >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14.
                                                                        
    Because test >=1.14.5 <1.15.0 depends on test_api 0.2.16 and test >=1.13.0 <1.14.5 depends on test_api 0.2.15, test >=1.13.0 <1.15.0 requires test_api 0.2.15 or 0.2.16.
    And because test >=1.15.0 <1.15.1 depends on test_core 0.3.8, test >=1.13.0 <1.15.1 requires test_api 0.2.15 or 0.2.16 or test_core 0.3.8.
    And because test >=1.15.1 <1.15.2 depends on test_core 0.3.9 and test >=1.15.2 <1.15.3 depends on test_core 0.3.10, test >=1.13.0 <1.15.3 requires test_core 0.3.8 or 0.3.9 or 0.3.10 or test_api 0.2.15 or 0.2.16.
    And because test >=1.3.0 <1.13.0-∞ or >1.13.0 <1.14.0-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14 (1), test >=1.3.0 <1.15.3-∞ or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14 or 0.2.15 or 0.2.16 or test_core 0.3.8 or 0.3.9 or 0.3.10.
    And because every version of flutter_test from sdk depends on both boolean_selector 2.0.0 and test_api 0.2.17, if flutter_test any from sdk and test >=1.3.0 <1.15.3-∞ or >=1.16.0-nullsafety then test_core 0.3.8 or 0.3.9 or 0.3.10.
(2) So, because test >=1.15.3 <1.16.0-nullsafety depends on test_core 0.3.11 which depends on analyzer ^0.39.5, if flutter_test any from sdk and test >=1.3.0 then analyzer ^0.39.5.
                                                                        
    Because no versions of built_value_generator match >6.5.0 <6.6.0 and built_value_generator >=6.6.0 <6.8.0 depends on analyzer >=0.34.0 <0.37.0, built_value_generator >6.5.0 <6.8.0 requires analyzer >=0.34.0 <0.37.0.
    And because built_value_generator >=6.8.0 <7.0.4 depends on analyzer >=0.34.0 <0.39.0 and built_value_generator 6.5.0 depends on analyzer >=0.33.3 <0.37.0, built_value_generator >=6.5.0 <7.0.4 requires analyzer >=0.33.3 <0.39.0.
    And because if flutter_test any from sdk and test >=1.3.0 then analyzer ^0.39.5 (2), one of flutter_test any from sdk or test >=1.3.0 or built_value_generator >=6.5.0 <7.0.4 must be false.
    And because hn_app depends on built_value_generator ^6.5.0, flutter_test from sdk is incompatible with test >=1.3.0.
    So, because hn_app depends on both test ^1.6.1 and flutter_test any from sdk, version solving failed.
Running "flutter pub get" in hn_app...                                  
pub get failed (1;     So, because hn_app depends on both test ^1.6.1 and
flutter_test any from sdk, version solving failed.)

like image 909
Mateen Kiani Avatar asked Sep 07 '20 04:09

Mateen Kiani


People also ask

How to avoid dependencies in Azure SDK Bom?

The dependencies listed in the Azure SDK BOM are tested rigorously to avoid dependency conflicts. Remove dependencies if you can. Sometimes, an application has dependencies on multiple libraries that provide essentially the same functionality.

Is the resolved dependency version compatible with all consumers of dependencies?

However, it's not guaranteed that the resolved dependency version is compatible with all consumers of that dependency in your application. For more information, see Introduction to the Dependency Mechanism in the Maven documentation and Understanding dependency resolution in the Gradle documentation.

How to find unused dependencies of the project (JasperReports)?

[WARNING] Unused declared dependencies found:[WARNING] jasperreports:jasperreports:jar:3.5.3:compile You can see the command lists the unused dependencies of the project (jasperreports) dependency:analyze-duplicate This command will go over your dependencyMangement and dependencieson the pom.xmland find out the duplicate dependencies used.

Who is responsible for SDKs and SDKs?

As an app developer, you are responsible for the overall user experience and code shipped in your app, including those provided by any third-party SDKs. When you’re considering SDKs and libraries, it’s important to learn about their handling and usage of data, so you can better protect your users’ privacy.


2 Answers

Remove all version numbers from the dependencies in your pubspec.yaml and let Flutter determine the versions

Example:

Replace this

test: ^1.15.0
test_core: 0.3.8

with this

test: 
test_core: 
like image 51
lenz Avatar answered Oct 17 '22 23:10

lenz


For some reason Adding analyzer in the dependency_overrides section solved this issue. Here is how my pubspec.yaml file looks like:

dev_dependencies:
  build_runner: ^1.4.0
  built_value_generator: ^6.5.0
  moor_generator: ^1.4.0

dependency_overrides:
  analyzer: '0.39.14'
like image 40
Mateen Kiani Avatar answered Oct 18 '22 01:10

Mateen Kiani