[Flutter] sdk version 오류
Featured image of post [Flutter] sdk version 오류

[Flutter] sdk version 오류

minSdkVersion 16 cannot be smaller than version 19 declared in library

에러 내용

cloud_firestore 패키지를 설치하고 AVD를 빌드 했을 때 발생한 오류

에러 사진

image


원인

flutter에서 빌드 시, 특정 라이브러리가 minsdk버전을 충족하지 못하면 아래와 같은 에러가 발생하게 됩니다.


해결방법

android > app > build.gradle을 보면 다음과 같이 되어있다

image

1
2
3
4
5
6
7
    defaultConfig {
        applicationId "com.example.firebase_login"
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

여기에서 minSdkVersion을 21로 변경해준다.

1
2
3
4
5
6
7
    defaultConfig {
        applicationId "com.example.firebase_login"
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

참고자료

https://stackoverflow.com/questions/71495205/uses-sdkminsdkversion-16-cannot-be-smaller-than-version-19-declared-in-library

Built with Hugo
Theme Stack designed by Jimmy