android – Can not work the build "flutter build apk" command, But "flutter build ios" can work-ThrowExceptions

Exception or error:

enter image description here

I am a beginner.
Currently I am trying to build my flutter app for iOS and android .
I can build successfully in ios by  “flutter build ios”.
But I have the following issue with “flutter build apk”.
I will be very happy if someone can help to answer for the following issue (Ref attach img).

Doctor summary (to see all details, run flutter doctor -v):

Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.3 19D76, locale en-SG)
Android toolchain - develop for Android devices (Android SDK version 29.0.0)
Xcode - develop for iOS and macOS (Xcode 11.3.1)
Android Studio (version 3.5)
VS Code (version 1.42.1)
Connected device (1 available)
How to solve:

first try
flutter clean

then flutter pub cache repair

if the problem still persists,

Check for compilesdkversion everywhere in the folder and match it with one in android/app/build.gradle

Check here, same kind issue is closed in flutter

Leave a Reply

Your email address will not be published. Required fields are marked *