色々やりたい系エンジニアのメモ

技術情報、勉強日記などを書きます

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

エラー

/Users/【ユーザ名】/VScodeProjects/【プロジェクト名】/android/app/src/debug/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:cloud_firestore] 
/Users/【ユーザ名】/VScodeProjects/【プロジェクト名】/build/cloud_firestore/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 16

Suggestion: use a compatible library with a minSdk of at most 16,
        or increase this project's minSdk version to at least 19,
        or use tools:overrideLibrary="io.flutter.plugins.firebase.firestore" to force usage (may lead to runtime failures)

やってみたこと

  • エラーに書かれている通り、android/app/build.gradleminSdkVersionを19にしてみた

結果

別のエラーが出た

これについて細かく見ていないが、SDKバージョン19というのはAndroid4.4相当らしく、今デバッグ端末で使っているAndroid端末はバージョン12なのでもう少し新しくすれば動くのではと思った

参考 APIレベルとAndroidバージョンの関係

developer.android.com

最終的に動いた方法

android/app/build.gradleminSdkVersionを30にすると動作した