Flutter run error : You have not accepted the license agreements

前端 未结 12 2130
面向向阳花
面向向阳花 2020-12-03 17:04

I\'m developing android and ios app with Google flutter.
when I add a new dependency like shared_preferences to pubspec.yaml and then execute

相关标签:
12条回答
  • 2020-12-03 17:38

    For newer installations (especially on MacOS) flutter doctor --android-licenses does not work. Run the following command (notice the new path to sdk cmdline tools) and you will able to accept the licenses:

    ~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses

    0 讨论(0)
  • 2020-12-03 17:38

    I think is a little late to answer this question, but I think this can be useful for those who are starting in Flutter like me.

    In my case (at my machine), I've executed the steps below:

    Before run given command please make sure that you have done with environment variable setup on windows/mac/i/Linux/Unix for

    1. Android SDk
    2. sdkmanager
    3. Java
    4. Flutter

    Note:- update variable path with your sys path for example

    1. Execute command prompt as administrator; Run the command flutter doctor --android-licenses
    2. press y to accept every license.;
    3. flutter doctor -v to check if the issue was solved;
    0 讨论(0)
  • 2020-12-03 17:39

    For me , flutter doctor --android-licenses didn't work for some reason.

    The only cmd that worked & solved it all was this:

    (your android_sdk folder exact path)\tools\bin\sdkmanager --licenses

    0 讨论(0)
  • 2020-12-03 17:42

    I had java SE 11 installed and its variables set up.

    It somehow interfered with flutter!

    1. Double-check your java path entry. Go to your java environment variables and double-check your path entry. Keep one of them in the bin and remove the other.

      Mine:

      C:\Program Files\Java\jdk-11.0.8\bin
      C:\Program Files\Java\jdk-11.0.8
      
    2. In the command line just run flutter doctor --android-licenses accept everything (by clicking y key followed by enter key).

    0 讨论(0)
  • 2020-12-03 17:43

    If you are in windows open command prompt as admin and run the following command.

    flutter doctor --android-licenses
    

    Then enter y for all (y/n) to accept agreement.

    0 讨论(0)
  • 2020-12-03 17:44

    Installing Android SDK Tools (Obsolete) 26.1.1 worked for me. I found this at another link. I will try to find and pasted here. Remember to un-select show obsolete so you can find the SDK.

    After this, I was able to do Flutter doctor Android Licenses and select y.

    0 讨论(0)
提交回复
热议问题