最近UdemyでFlutterを学習しています。
その中でfirebaseとの連携をする際に以下のエラーが出たのでメモを残します。
uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library
エラーの意味
エラー文を直訳すると
uses-sdk:minSdkVersion 16 は、ライブラリで宣言されたバージョン 19 よりも小さくできません。
つまりバージョンを19以上にあげてねという意味ですね。
解決策
エラー文の指摘通りminSdk versionのバージョンを上げてあげましょう。
android/app/build.gradleの中にdefaultConfigの記述がありminSdkVersionというところがあります。
ここを手動で19より大きい値にしてもう一度確認してみてください。
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.hogehoge"
minSdkVersion 23 //ここの数字を19以上にする
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}