![]() ![]() ![]() Updates and upgrades should be straightforward, and we can document builds and releases to a particular setup. The remaining dependencies are all installed via homebrew. This is what you should see if all the above was done right.Īfter completing all the above steps we now know that dart, flutter, ruby are all managed via asdf. ![]() export INTEL_HAXM_HOME=/usr/local/Caskroom/intel-haxmĮxport JAVA_HOME=$(/usr/libexec/java_home -v 1.8)įinally lets check our flutter install flutter doctor -v bash_profile files if you get complaints about haxm or java. Run sdkmanager to make sure all dependencies are installed (depends on adoptopenjdk8 that we installed via brew) sdkmanager We need to accept the android licences in order to build our flutter app for android flutter doctor -android-licenses We need to accept the licences for xcode in order to build ios apps sudo xcodebuild -license Simply open up the app, go to configure > plugins and then install from the dialog as shown below. You will need to install the flutter and dart plugins for android studio, otherwise flutter doctor will complain later on. Install the cocoapods dependencies pod setup The latest version of cocopads (1.8.4) doesn't respect the pod setup command on macOS catalina, so we have to use an older version until this bug is resolved. We don't need to use sudo we can install direct into the asdf ruby version. You can set these to local if you have multiple projects that rely upon different versions.Īsdf global flutter 1.12.13+hotfix.7-stableĬocoapods install on macOS Mojave and below asdf install dart 2.7.0Īsdf install flutter 1.12.13+hotfix.7-stable You can use the latest version of Ruby if you like, but I've come across issues. We will use ruby 2.3.7 because it allows us to install cocoapods on macOS catalina.Install the asdf plugins for dart, flutter and ruby.There are three steps for asdf, but this won't take long except depending on your download speed. adoptopenjdk8 prebuilt java binary to make sure the above android stuff works.intel haxm to help speed up flutter rendering.android studio to build flutter apps for android.android sdk for command line util sdkmanager.asdf for our dart, flutter and ruby runtimes.This will install the dependencies for flutter and asdf which we will use to install the runtimes. ![]() This could take a while depending on your download speed. You should also install xcode via the mac app store. If you don't have asdf installed already, you can follow my tutorial on how to install asdf You need to make sure you have homebrew installed and also asdf to manage runtime dependencies. Until a complete homebrew approach is released, I think this is a decent step by step approach. Moreover, we know where everything belongs and how to upgrade or uninstall if necessary. This is particularly valuable if you use different machines, or have team members in different locations. I came across too many issues, and it took a lot of stackoverflow and google searches to overcome.īy using a package manager to install dependencies and runtimes, we can share the exact same setup in different environments and automate the install and escape the above issues. I became particularly frustrated when trying to setup flutter on macOS Mojave and macOS Catalina. The official way to install the flutter and its dependencies is a mishmash of brew install, binary downloads alongside relying on system installed versions of ruby. In this case xcode-select -reset works as pointed by akozin.How to install Flutter on macOS using homebrew and asdf You may get an error message: "Can't install the software because it is not currently available from the Software Update server". I found the solution in this question, Command Line Tools not working. Sudo xcode-select -switch /Library/Developer/CommandLineTools sudo xcode-select -switch /Applications/Xcode.app As a follow on step, you may need to reset the path to Xcode if you have several versions or want the command line tools to run without Xcode. The problem is that one needs to explicitly agree to the license agreement. If the above alone doesn't do it, then also run: sudo xcode-select -reset You do not need Xcode, you can install only the Command Line Tools here, it is about 130 MB (600 MB as of Xcode v14.1). Using the default Ruby install will require you to use sudo when installing gems. You can use a Ruby Version manager, however we recommend that you use the standard Ruby available on macOS unless you know what you're doing. (The popped Window may be behind other windows.) CocoaPods is built with Ruby and it will be installable with the default Ruby available on macOS. This will pop a dialogue box, Select "Install", and it will download and install the Command Line Tools package and fix the problem. Open Terminal, and run the following: xcode-select -install ![]()
0 Comments
Leave a Reply. |