flutter helloworld项目报错:Could not resolve all files for configuration ‘:app:_internal_aapt2_binary’.
继续浏览的前提是你已经实现了科学上网,并确保在AS中设置的proxy代理测试是通过的。注意一定要在AS中再设置一次Proxy(或者直接设置http_proxy和https_proxy全局变量代理),科学上网工具的全局代理不一定在AS中起作用。
1. 根据错误提示手动删除过,也试过网友介绍的其他方法例如android.enableAapt2=false,sync但是最终都没有效果(这里false和sync中间是英文逗号,不然可能会引起新的错误不能decode)
2.根据多次反复尝试,发现build.gradle中的dependenices里的gradle版本爆黄。然后修改了版本有3.5.8改为3.6.4
classpath ‘com.android.tools.build:gradle:3.6.4’
然后再次运行,提示错误(部分截取)
Minimum supported Gradle version is 5.6.4. Current version is 5.6.2.
这还有啥好说的,立马改了gradle-wrapper.properties里版本号为5.6.4
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip
再次运行成功。