1. Failed to find the each_child method after adding third-party libraries when flutter was run by Android Studio on Mac

  • Cause: each_child is a method after ruby2.5
  • Solution: Use it on the terminalrvm install version(Ruby version to install)RVM use Ruby version numberYou can specify which version of Ruby to use, install Cocoapods if you can’t find it, and restart your computer if an error is reported
RVM install version RVM use 2.6.0 // I installed 2.6.0, the installation process will not have other strange problems 👌 RVM list // check the current computer version of RubyCopy the code

2. Under Mac, Android Studio runs the Flutter project to Android emulator and receives a Connection timed out error

  • Cause: Download and update of gradle packaging tool timed out in Android project
  • Solutions:
  1. Check the flutter project/android/gradle/wrapper/gradle – wrapper. The properties file using gradle version, and use the browser to download distributionUrl this path resource file zip (You are advised to use curl to download the file. Curl -c – is used to download the file), do not decompress; Copy the downloaded ZIP file to the pathYour computer name /. Gradle/wrapper/dists/gradle - XXX (your project using version)/XXXX (random string name of the folder)Under, restart Android Studio. Opening the project will automatically decompress the zip file in the previous path
  2. Modify the Android /build.gradle file under the Flutter project to change the related image path to aliyun’s image
  3. If an SDK/ SDK Tools error is reported when starting Android Studio, you only need to configure the toolPreferences -> Appearance&Behavior -> System Settings -> Android SDK(Shortcut key :Command +,) inSDK PlatformsandSDK ToolsDownload and install the corresponding SDK version
Shortcut: Buildscript {ext.kotlin_version = '1.3.50' repositories {// Google () // jCenter ()  maven { url 'https://maven.aliyun.com/repository/google'} maven { url 'https://maven.aliyun.com/repository/jcenter'} maven { url 'http://maven.aliyun.com/nexus/content/groups/public'} } dependencies { classpath 'com. Android. Tools. Build: gradle: 4.1.0' classpath "org. Jetbrains. Kotlin: kotlin - gradle - plugin: $kotlin_version"}} allprojects { repositories { // google() // jcenter() maven { url 'https://maven.aliyun.com/repository/google/' } maven { url 'https://maven.aliyun.com/repository/jcenter/'} maven { url 'http://maven.aliyun.com/nexus/content/groups/public'} }}Copy the code