Handling Gradle Exceptions Within a Flutter Project Utilizing the atPlatform

Handling Gradle Exceptions Within a Flutter Project Utilizing the atPlatform

If you are encountering Gradle issues when using the at_backupkey_flutter or atsign_authentication_helper libraries, there are some Gradle configuration updates you may need to make for your project to compile successfully.


As part of the implementation of these libraries, the minimum supported version is higher than the default version supported by a common, Flutter project. In order to properly build with Gradle, there are a few changes that you need to be aware of for your application.

Some required updates include:

Navigate to the Android folder in your project and open the app folder. Here you will find a file called build.gradle. Confirm that the following items are calling the correct, higher version, such as;

android {        
            compileSdkVersion 29
            defaultConfig {
                 minSdkVersion 24
                 targetSdkVersion 30

Next, navigate within your android folder (not in the app folder) you will find another build.gradle file. Within this, be sure to take note of the following items;

dependencies {
           classpath ‘com.android.tools.build:gradle:4.0.1'

lintOptions {
          disable 'InvalidPackage'
          checkReleaseBuilds false

Edit the gradle.properties file that can be found in the Android folder.


Finally, In android/gradle/wrapper/gradle-wrapper.properties, change to:


With all of these items listed correctly, your project should be good to build with your shiny new Gradle!

Cover Image Credit : gradle.org