Exception: Gradle task assembleDebug failed with exit code 1
solution:
This problem occurs, it may be that the dependent plug-in cannot be downloaded
Find the android->build.gradle of the project,
Will
google()
mavenCentral()
changed to
maven{url 'https://maven.aliyun.com/repository/google' }
maven{url 'https://maven.aliyun.com/repository/google-plugin' }
maven{url 'https://maven.aliyun.com/repository/public' }
maven{url 'https://maven.aliyun.com/repository/jcenter' }
Open packages->flutter_tools->grale->flutter.gradle in the flutter SDK
will
maven{url 'https://maven.aliyun.com/repository/google' }
maven{url 'https://maven.aliyun.com/repository/google-plugin' }
maven{url 'https://maven.aliyun.com/repository/public' }
maven{url 'https://maven.aliyun.com/repository/jcenter' }
Add to the front of google()
If the above method is still not resolved
Find the gradle-6.7-all file of your own problem , delete it, and download it again.
If it doesn't work, it may be caused by the gradle package version, which does not match the version of your Androidstudio. Find the gradle-wrapper.properties file
Change the version of the gradle package, you can try to downgrade the version, the latest is not necessarily the best.
Finally run successfully.