In my flutter app, flutter build apk succeeds without warning but android.app.build.gradle has an error in this code:
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
The error is
unable to resolve class GradleException
whereis flutter returns "/home/mark/dev/flutter/bin/flutter".
flutter doctor -v returns Flutter version 3.3.1 on channel stable at /home/mark/dev/flutter` and has no errors.
my local.properties file contains flutter.sdk=/home/mark/dev/flutter
How can I resolve this error?
Remove the new keyword before GradleException.
try this
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With