[Flutter] Running Gradle task'assembleDebug' android is very slow to package for the first time

Reason: It
will be stuck in Running'gradle assembleDebug when running, because Gradle's Maven warehouse is abroad, you can use the mirror address of Alibaba Cloud.

Solution

  • Modify the android/build.gradle file in the project
	   //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' }
  • Modify the Flutter configuration file, which is in the Flutter installation directory/packages/flutter_tools/gradle/flutter.gradle
        //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' }

Guess you like

Origin blog.csdn.net/uk_51/article/details/104844239