My Flutter project failed to build today with the following error:
Where: Build file 'D:\Dev\Flutter\Projects\Misc\flutter_app\android\app\build.gradle' line: 26
What went wrong: A problem occurred evaluating project ':app'.
Could not resolve all artifacts for configuration 'classpath'. Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
I also started a brand new Flutter project in Android Studio, without changing anything, and got the same error.
I am running Android Studio 3.2.1 (9 October) build on Windows 10 64-bit.
This is my Flutter doctor output:
> D:\Dev\Flutter\Flutter\bin\flutter.bat --no-color doctor Doctor
> summary (to see all details, run flutter doctor -v): [√] Flutter
> (Channel master, v0.10.2-pre.30, on Microsoft Windows [Version
> 10.0.17134.345], locale en-AU) [√] Android toolchain - develop for Android devices (Android SDK 28.0.3) [√] Android Studio
> X Flutter plugin not installed; this adds Flutter specific functionality.
> X Dart plugin not installed; this adds Dart specific functionality. [√] Connected device (1 available)
>
> • No issues found! Process finished with exit code 0
(Ignore the Flutter and Dart plugin-not-installed warnings, they are always there for me although everything works)
I have tried other suggestions such as making sure the google() repository is on top of the Gradle build files, but no luck.