Flutter markdown package dependency did not install correctly for me

898

I solved this thanks to @raju-bitter comment. Steps:

  • Close your IDE (Android Studio/Intellij Idea/etc)
  • Remove the cache directory (My was located at C:\Users\Username\AppData\Roaming\Pub)

  • Reopen your IDE.

If you still get an error then execute flutter package get in your terminal or from IDE menu.

Share:
898
ZeroProcess
Author by

ZeroProcess

Updated on December 02, 2022

Comments

  • ZeroProcess
    ZeroProcess over 1 year

    I wan to use flutter markdown package, but I can't. I added dependency (in pubspec.yaml):

    dependencies:
      flutter_markdown: "^0.0.9"
    

    After I upgraded package and dependency, but when I used

    import 'package:flutter_markdown/flutter_markdown.dart';
    

    statement I got error message URI doesn't exist. I upgraded flutter and tried again, but nothing. I tried adding another way:

    dependencies:
      flutter_markdown:
        git: "https://github.com/flutter/flutter_markdown.git"
    

    But result is the same.

    How can I solve this problem?

    (I use other packages without problem.)

    • Günter Zöchbauer
      Günter Zöchbauer almost 7 years
      Have you tried restarting Intellij?
    • Collin Jackson
      Collin Jackson almost 7 years
      Adding a dependency on flutter_markdown: "^0.0.9" as you've shown worked fine for me. Can you show a screenshot of the error message you're encountering?
    • ZeroProcess
      ZeroProcess almost 7 years
      Yes I tried restarting.
    • ZeroProcess
      ZeroProcess almost 7 years
    • raju-bitter
      raju-bitter almost 7 years
      I had a similar experience yesterday with another package. After completely removing the ~/.pub-cache folder, restarting IntelliJ, and running flutter package get again it worked.
    • raju-bitter
      raju-bitter almost 7 years
      Do you see the Dart package in the list of External Libraries - Dart Packages inside IntelliJ? And can you see the package folder inside your .pub-cache folder, e.g. ~/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.0.9/‌​?
    • Günter Zöchbauer
      Günter Zöchbauer almost 7 years
      Removing ~/.pub-cache is a bit radical. I'd try that last and also try running pub cache repair first.
    • raju-bitter
      raju-bitter almost 7 years
      Tried that, but didn't solve my problem.
    • Seth Ladd
      Seth Ladd almost 7 years
      Did you run flutter packages get on the command line, after you added the dependency to your pubspec.yaml ?