0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

[Flutter/Android]「uses-sdk:minSdkVersion XX cannot be smaller than version YY declared in library」のエラー解消

Last updated at Posted at 2022-02-26

環境

Windows 10 Home
Flutter 2.10.2
Dart 2.16.1
Android Studio 4.0.1

エラー内容

Androidのエミュレータにてビルド時に下記のエラーが発生。

uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library

「SDKのバージョン19以上じゃないとだめなので(今は16)、minSdkVersionを上げてね」ということでした。

解決方法

android/app/build.gradledefalutConfigの中に、minSdkVersionを指定できるのでそこを変更しましょう。

android/app/build.gradle|変更前
    defaultConfig {
        // ...略
        minSdkVersion 16
        // ...略
    }
android/app/build.gradle|変更後
    defaultConfig {
        // ...略
        minSdkVersion 19
        // ...略
    }

変更前の段階でminSdkVersion flutter.minSdkVersionと入っている場合も気にせず数値指定でOKです。
今回は変更後のminSdkVersionを19としましたが、自分のエラーに合わせて最適なminSdkVersionを指定すればOKです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?