Published on

Solution for “Error: Member not found: ‘packageRoot’. ../…/interface/local_platform.dart:45 String get packageRoot => io.Platform.packageRoot;”

Error Debug Wallpaper

Problem: Trying to run a Flutter application throws this error:

Error: Member not found: 'packageRoot'. ../…/interface/local_platform.dart:45
String get packageRoot => io.Platform.packageRoot; ^^^^^^^^^^^

Solution: This error is most likely caused by the platform package not being included in application. To fix this error add the package: ^3.1.0 line in the dependencies section of the pubspec.yaml file:

dependencies:
  ...
  platform: ^3.1.0

Don't forget to run flutter pub get afterwards!

Conclusion

Thanks for reading this blog post!

If you have any questions or concerns please feel free to post a comment in this post and I will get back to you when I find the time.

If you found this article helpful please share it and make sure to follow me on Twitter and GitHub, connect with me on LinkedIn and subscribe to my YouTube channel.