flutterdartflutter-dependenciesflutter-pubflutter-upgrade

Flutter: no versions of permission_handler match >5.1.0+2 <6.0.0


After upgrading Flutter and Dart to the latest versions I also updated the dependencies of my app. Now, when I run flutter pub get I get the following error:

Because no versions of permission_handler match >5.1.0+2 <6.0.0 and permission_handler 5.1.0+2 depends on permission_handler_platform_interface ^2.0.2, permission_handler ^5.1.0+2 requires permission_handler_platform_interface ^2.0.2.
And because no versions of permission_handler_platform_interface match >2.0.2 <3.0.0 and permission_handler_platform_interface 2.0.2 depends on plugin_platform_interface ^1.0.2, permission_handler ^5.1.0+2 requires plugin_platform_interface ^1.0.2.        
And because geolocator >=7.0.0 depends on geolocator_platform_interface ^2.0.0 which depends on plugin_platform_interface ^2.0.0, permission_handler ^5.1.0+2 is incompatible with geolocator >=7.0.0.
So, because MyApp depends on both geolocator ^7.0.1 and permission_handler ^5.1.0+2, version solving failed.
Running "flutter pub get" in flutter_app...                             
pub get failed (1; So, because MyApp depends on both geolocator ^7.0.1 and permission_handler ^5.1.0+2, version solving failed.)

I do not quite understand where the error is and what I can do to fix it. If there is any information missing, I will add it as soon as I can. Does anyone have an idea what I need to change in the dependencies?

Here is my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.1, on Microsoft Windows [Version 10.0.19042.804], locale de-DE)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] IntelliJ IDEA Ultimate Edition (version 2020.3)
[√] Connected device (3 available)

• No issues found!

Solution

  • That’s because this package doesn’t support null safety yet. I think you should rather create an issue on their GitHub repository instead of asking the question here.