Fixing Mobile Tools when Flutter Doctor complains, V2

Fixing Mobile Tools when Flutter Doctor complains, V2

(This is an amendment to a previous article I published. New computer = new understanding of old problems as I go through them for a second time.)

I was recently tasked with setting up Flutter and Dart on a MacOS machine that already had the Android Studio UI installed on it. I am making these notes in case anyone should encounter similar difficulties (including myself, later on).

No alt text provided for this image

Above, you can see that running "flutter doctor -v" has produced a clean bill of health, except for issues with missing command lines and unaccepted licenses.

Step 1 -- Getting the Command Line Tools

I downloaded "Command Line Tools Only" (since I already had the UI) from this location.

You can go into Android Studio and choose "Project Structure" from the File menu to find where your SDK is currently located...

No alt text provided for this image

This bit is important, I had to take the contents of the ZIPped download and put it in a folder within the above location called cmdline-tools/latest ...

No alt text provided for this image

Step 2 -- Accepting the licenses

Once you've done this, you should do 2 things...

First, make sure that your cmdline-tools' bin directory is added to your path. Then, run "sdkmanager --licenses". Follow the prompts to review and approve all available licenses.

No alt text provided for this image

Step 3 -- Install CocoaPods (on Mac)

If you are using a Mac and get grief about not having CocoaPods, simply run "sudo gem install -n /usr/local/bin cocoapods".

Step 4 -- Link to a new location for Java

On a brand new install, you need to do a couple of things to tell Flutter where to find Java. First, you need to set your JAVA_HOME variable to point to "/Applications/Android Studio.app/Contents/jbr/Contents/Home". Second, you need to run the instructions below, because the latest Android Studio distributions put Java in the "jbr" folder and it is expected by Android in a "jre" folder.

cd /Applications/Android\ Studio.app/Contents
ln -s jbr jre        

Finally -- rerun the Doctor!

Now, when you run "flutter doctor -v", you should get output with nothing but green check marks next to it. You are fully installed and ready to go!

要查看或添加评论,请登录

Derek Ferguson的更多文章

  • Notes on Creation of NFTs

    Notes on Creation of NFTs

    I recently created an NFT following the instructions in this excellent tutorial. I had to make some adjustments as I…

  • Setting up for Amplify Mobile Development

    Setting up for Amplify Mobile Development

    This won't be anything elaborate, but I'm working my way through Adrian Leung's excellent "Rapid Application…

  • Hackathon 2021: World Innovation Day

    Hackathon 2021: World Innovation Day

    This year, Hackmakers hosted a global hackathon in support of the UN's sustainable development goals. My employer…

    2 条评论
  • Hackathon - Testing the Environment

    Hackathon - Testing the Environment

    This week, technologists from around the world will be participating in a Hackathon in support of the United Nations'…

    1 条评论

社区洞察

其他会员也浏览了