执行flutter doctor
命令时没有错误。我尝试用最新版本6.4更新Gradle,并在dist文件夹中的env变量路径中也进行了设置,它也正确显示。
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-bin.zip
- compileSdkVersion 28
- targetSdkVersion 28
google()已添加到所有项目和buildscript.repositories
I tried all approaches mentioned in similar kind of queries in StackOverflow and other platforms but of no use, I am totally stuck here.
how to resolve this error?
在错误之后,flutter run
命令上显示的信息是
正在运行Gradle任务“ assembleDebug” ...
[Fatal Error] aapt2-3.5.0-5435860.pom:2:1: Content is not allowed in prolog.** FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:mergeDebugResources'. > Could not resolve all files for configuration ':app:_internal_aapt2_binary'. > Could not resolve com.android.tools.build:aapt2:3.5.0-5435860. Required by: project :app > Could not resolve com.android.tools.build:aapt2:3.5.0-5435860. > Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.5.0-5435860/aapt2-3.5.0-5435860.pom > Content is not allowed in prolog. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 6m 22s Running Gradle task 'assembleDebug'... Running Gradle task 'assembleDebug'... Done 401.6s (!) Exception: Gradle task assembleDebug failed with exit code 1