Flutter报错:Required by: project :app > project :XXXX
或
Flutter报错:Could not resolve com.android.tools.build:gradle:3.5.0
修改步骤(笔者使用的mac):
1.修改镜像(app/build.gradle)
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' }
mavenLocal()
mavenCentral()
2.同步修改flutter.gradle文件(文件路径在flutter安装路径/packages/flutter_tools/gradle
/flutter.gradle)不清楚安装路径可以在设置中查看到;
3.删除gradle.properties文件(文件路径在用户/.gradle/)
以上主要参考:
https://www.jianshu.com/p/0b4f2ffeb1f1
https://www.jianshu.com/p/6cd9cdab70b1
感谢!