![]() Unable to find bundled Java versionĪfter doing some research, I found a fix on Stackoverflow.įirst, you need to set a JAVA_HOME environment variable as described in this article.Īfter JAVA_HOME is set you create a symbolic link from the jre to a new jdk folder. Flutter doctor said it was “Unable to find bundled Java version” for Android Studio. However, when I ran Flutter doctor again, it showed a weird problem that isn’t mentioned in Flutter’s documentation. I installed Android Studio from the link that was suggested by Flutter doctor and assumed that would fix everything. I don’t think you need the Android toolchain if you only want to build applications for macOS but since I’m a sucker for green checkmarks, I set up the Android toolchain as well. This gave me a green checkmark for the Xcode part. sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunchįlutter doctor also showed I didn’t have CocoaPods installed, so I installed that as well. ![]() ![]() Once the installation finished, I ran the commands that are suggested by Flutter doctor. Since I wasn’t sure what part of my Xcode installation was missing, I installed the complete thing again via the app store. Though your mileage may vary, in my case Flutter doctor revealed that I have an incomplete Xcode installation and no Android toolchain. The results of flutter doctor the first time I ran the command. which flutter result: /Users/bas/tools/flutter/bin/flutter We can now verify that the Flutter command can be found. For our change to have any effect, we need to either restart the terminal or source the rc file. The terminal won’t pick up the altered PATH automatically. cat ~/.zshrc result: export PATH="$PATH:/Users/bas/tools/flutter/bin" If we inspect the contents of the rc file with cat it should show the changes you made. ![]() nano ~/.zshrcĪdd a new line to export the path of your Flutter bin directory. To update the ~/.zshrc file I use the nano editor. If you have a recent version of macOS you are probably using zsh, since starting with macOS Catalina, zsh is the default shell. If you are using Z shell (zsh) you have to edit ~/.zshrc. In case you are using Bash, edit either ~/.bash_profile or ~/.bashrc. The exact name of this file depends on the type of shell you are using. To add this path to our PATH variable, we have to update the rc file of our shell. This is the path to your Flutters bin folder, which we will need in a second. cd tools/flutter/bin pwd result: /Users/bas/tools/flutter/binĬopy the result of the pwd command. The easiest way to do this is by using the terminal to navigate into the flutter/bin folder and use the pwd command to print the current working directory. To run flutter commands in any terminal session, we have to add the Flutter SDK to our systems PATH variable.įirst, we will find the path to our Flutter bin folder. I recommend using the stable channel unless you have specific needs that are only available through more recent releases. There are four different release channels: stable, beta, dev, and master. This is okay for us because even though desktop support is still in the beta phase, it’s possible to create desktop builds on the stable branch. The last part of the git clone command, -b stable shows we want to download the stable branch. You should now see a new folder named flutter within the tools folder. Open your favorite terminal, navigate into the folder where you want to download the SDK, and clone the SDK into this folder. This article will demonstrate the latter option. You can either download the SDK, use Homebrew, or download it straight from GitHub. We can install the Flutter SDK in various ways. In this section, we will install the Flutter SDK and add it to our PATH variable so we can run the flutter command from any terminal window.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |