Skip to main content

Command Palette

Search for a command to run...

Solve AndroidStudio errors: #001 GradleException in app/build.gradle flutter project

Updated
1 min read
F

Software Engineer with a bag-pack, with custom made t-shirts a herb in the mouth and who cooks.

Welcome to short snippets to various problems that you encounter as you are coding. Let me get straight into it.

  1. Gradle error when editing a flutter app in the build.gradle file located in the android/app/build.gradle

This is the error:

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.") }

Solution: Replace the GradleException with FileNotFoundException see code snippet below:

def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new FileNotFoundException ("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") }

Update your compile SDK Version

android { compileSdkVersion to 29 (and 29++)

and

applicationId "name of AppID" minSdkVersion any targetSdkVersion 29 (and 29++) versionCode flutterVersionCode.toInteger() versionName flutterVersionName }

that is it folks!

Like and share!

More from this blog

F

Frank Tamre's Blog

21 posts

Cook, Speak, Travel, Mentor, Teach, Build