본문 바로가기
Project/Google Solution Challenge 2024

[Flutter] Error: uses-sdk:minSdkVersion 19 cannot be smaller than version 21

by 빠니몽 2024. 1. 23.

01.23.2024

1. Error

The following error occurred while trying to build an android emulator in flutter.

Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:flutter_facebook_auth] /Users/jeonghyeon/project/myproject/build/flutter_facebook_auth/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 19

 

This basically means that the version of your project has a minimum version for SDKs which is 19, and the supported minimum version for flutter and the one of SDKs (facebook_auth for my case) don't match.

What you have to do is manually match them.

2. Solution 

Currently, the minimum SDK version supported by flutter is 19.

since the minSDKVersion of facebook_auth supports the version 21 or above, I changed flutter.minSDKVersion to 21 

 

// in .../yourproject/android/app/build.gradle

...

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.strecording"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

...