当前位置: 首页>编程语言>正文

Mac flutter环境配置以及Xcode中引入flutter

Mac 如何配置 flutter环境

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale

    zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)

    Android licenses not accepted.  To resolve this, run: flutter doctor

      --android-licenses

[✗] iOS toolchain - develop for iOS devices

    Xcode installation is incomplete; a full installation is necessary for iOS

      development.

      Download at: https://developer.apple.com/xcode/download/

      Or install Xcode via the App Store.

      Once installed, run:

        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

    libimobiledevice and ideviceinstaller are not installed. To install with

      Brew, run:

        brew update

        brew install --HEAD usbmuxd

        brew link usbmuxd

        brew install --HEAD libimobiledevice

        brew install ideviceinstaller

    ios-deploy not installed. To install with Brew:

        brew install ios-deploy

    Brew can be used to install tools for iOS device development.

      Download brew at https://brew.sh/.

[✓] Android Studio (version 3.2)

    Flutter plugin not installed; this adds Flutter specific functionality.

    Dart plugin not installed; this adds Dart specific functionality.

[!] IntelliJ IDEA Ultimate Edition (version 2016.2.4)

    Flutter plugin not installed; this adds Flutter specific functionality.

    Dart plugin not installed; this adds Dart specific functionality.

    This install is older than the minimum recommended version of 2017.1.0.

[!] Connected device

    ! No devices available

如何解决这些问题呢:我下载了一个Android studio  


按照brew时出现的问题:

==> Downloading and installing Homebrew...

fatal: cannot copy '/Library/Developer/CommandLineTools/usr/share/git-core/templates/hooks/pre-receive.sample' to '/usr/local/Homebrew/.git/hooks/pre-receive.sample': Permission denied

Failed during: git init -q

我把所有的xcode关闭了就可以了。原来如此,我看网上获取权限的方法不行。

Xcode中如何引进flutter

我是参照了网络上的文章 https://www.jianshu.com/p/fcc5c6138a23

1.  在命令行输入,需要和项目在同级目录下

flutter create -t module  my_flutter(这个名字自己取)

然后就会出现

Mac flutter环境配置以及Xcode中引入flutter,第1张

2.接下来修改pod文件

platform :ios,'9.0'

inhibit_all_warnings!

target 'flutterTest' do

end

//这个路径要配置好,要不然会出现,找不到镜像 disk image.

//这个路径就是我们刚刚通过命令行生成的文件路径

flutter_application_path ='../flutter_module'

eval(File.read(File.join(flutter_application_path,'.ios','Flutter','podhelper.rb')), binding)

3.接下来你配置这个的时候记得勾选 Run script only when installing

要不然xcode10编译会出现  Command PhaseScriptExecution failed with a nonzero exit code

Mac flutter环境配置以及Xcode中引入flutter,第2张

https://www.xamrdz.com/lan/5sw2016285.html

相关文章: