0
votes

So I am new to app development I installed flutter as per the instruction on https://flutter.dev/docs/get-started/install

  1. Installed Flutter
  2. Installed Android Studio

When I am running the app this error comes up.

Here error msg I am getting

Here's the error msg

[Fatal Error] aapt2-3.2.1-4818971.pom:2:1: Content is not allowed in prolog.

FAILURE: Build failed with an exception.

  • What went wrong: Could not resolve all files for configuration ':app:_internal_aapt2_binary'.

Could not resolve com.android.tools.build:aapt2:3.2.1-4818971.

Required by: project :app

Could not resolve com.android.tools.build:aapt2:3.2.1-4818971. Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.2.1-4818971/aapt2-3.2.1-4818971.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 4s Finished with error: Gradle task assembleDebug failed with exit code 1

2
Try cleaning your gradle cacheIzabela Orlowska
How to clear gradle cache ?K Pradeep Kumar Reddy

2 Answers

1
votes

Try this,

1).Close android studio.

2).Delete all the contents of below directories.

 C:\Users\USER_NAME\.android\build-cache
 C:\Users\USER_NAME\.android\cache
 C:\Users\USER_NAME\.gradle\caches

3).Start Android Studio.

0
votes

Solved !!

So there was some problem in my Android SDK Path Variable which I fixed and also cleared my Gradle cache and it worked like charm.