之前运行的好好的项目,前几天开始突然就无法编译了,报错信息如下
Could not resolve all task dependencies for configuration ‘:app:releaseRuntimeClasspath’. Could not resolve com.mob:MobToolsMC:+. Required by: project :app project :app > project :mobpush_plugin Failed to list versions for com.mob:MobToolsMC. Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/mob/MobToolsMC/maven-metadata.xml. Could not get resource ‘https://google.bintray.com/exoplayer/com/mob/MobToolsMC/maven-metadata.xml’. Could not GET ‘https://google.bintray.com/exoplayer/com/mob/MobToolsMC/maven-metadata.xml’. Received status code 502 from server: Bad Gateway
这个问题上个月也出现过一次,大概持续了几天,后面又好了就没去注意; 这次持续了1个礼拜无法打包无法使用,网上一查,说是Bintray这个库被关闭了; 参见https://github.com/onfido/react-native-sdk/issues/55
我这里解决方案:
- 注释了gradle下的jcenter(),替换成mavenCentral();
google() // jcenter() mavenCentral() - 掉flutter根目录下(我的路径是C:\Users\Qian\flutter\packages\flutter_tools\gradle)文件下
的resolve_dependencies.gradle 以及flutter.gradle,同样注释掉jcenter(),替换成mavenCentral(); - 挨个注释掉依赖库的gradle内jcenter(),替换成mavenCentral();
- 看到依赖库中跟google.bintray有关的也注释掉,我这里是image_picker-0.6.7 这个库;
做了以上操作之后,删除pubspec.lock,重新跑就ok了。其实我觉得跟jcenter(),mavenCentral()的替换可能没有太大关系,主要是image_picker-0.6.7内的gradle有google.bintray这个链接。
|