Ad

Error Adding Depending On Flutter Project

I want to add firebase_dynamic_links package to my project but the following error is displayed when adding.

  firebase_dynamic_links: ^2.0.6

errore :

Because firebase_dynamic_links >=2.0.6 depends on firebase_core ^1.3.0 which depends on firebase_core_platform_interface ^4.0.1, firebase_dynamic_links >=2.0.6 requires firebase_core_platform_interface ^4.0.1.
And because firebase_core_platform_interface >=4.0.0 depends on plugin_platform_interface ^2.0.0, firebase_dynamic_links >=2.0.6 requires plugin_platform_interface ^2.0.0.
And because permission_handler_platform_interface 2.0.2 depends on plugin_platform_interface ^1.0.2 and no versions of permission_handler_platform_interface match >2.0.2 <3.0.0, firebase_dynamic_links >=2.0.6 is incompatible with permission_handler_platform_interface ^2.0.2.
And because permission_handler 5.1.0+2 depends on permission_handler_platform_interface ^2.0.2 and no versions of permission_handler match >5.1.0+2 <6.0.0, firebase_dynamic_links >=2.0.6 is incompatible with permission_handler ^5.1.0+2.
So, because gorzin_shop depends on both permission_handler ^5.1.0+2 and firebase_dynamic_links ^2.0.6, version solving failed.
pub get failed (1; So, because gorzin_shop depends on both permission_handler ^5.1.0+2 and firebase_dynamic_links ^2.0.6, version solving failed.)
Ad

Answer

The error is caused by your current dependencies version.

Some of them require an newer version of others, while other dependencies still require an older version.

First of all I would try to update every dependency.

You coud go in terminal inside your project and run flutter pub outdated to look for any outdated dependency.

If you have some, then you could run flutter pub upgrade to upgrade them.

If you want them to be updated to a newer resolvable version you could run flutter pub upgrade --major-versions. But be carefull becouse this could cause errors in your code.

If all of that doesn't solve your problem, you need to manually look for the one dependecy which cause the error and then try to check if there is a version of it compatible with all the others.

Ad
source: stackoverflow.com
Ad