Develop/Flutter

vscode 에서 flutter 프로젝트 android 시뮬레이터 실행 시 minSdkVersion 버전으로 인한 오류 발생 시 해결방법

issuemaker99 2024. 7. 5. 13:44
728x90

● 오류 내용 error log


Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
/Users/taeki/Develop/vsc_workspace/flutter_clone_instagram/android/app/src/debug/AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:firebase_auth] /Users/taeki/Develop/vsc_workspace/flutter_clone_instagram/build/firebase_auth/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
	Suggestion: use a compatible library with a minSdk of at most 21,
		or increase this project's minSdk version to at least 23,
		or use tools:overrideLibrary="io.flutter.plugins.firebase.auth" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 23 declared in library [:firebase_auth] /Users/taeki/Develop/vsc_workspace/flutter_clone_instagram/build/firebase_auth/intermediates/merged_manifest/debug/AndroidManifest.xml as the library might be using APIs not available in 21
  	Suggestion: use a compatible library with a minSdk of at most 21,
  		or increase this project's minSdk version to at least 23,
  		or use tools:overrideLibrary="io.flutter.plugins.firebase.auth" to force usage (may lead to runtime failures)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s


┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐
│ The plugin firebase_auth requires a higher Android SDK version.                               │
│ Fix this issue by adding the following to the file                                            │
│ /Users/taeki/Develop/vsc_workspace/flutter_clone_instagram/android/app/build.gradle:          │
│ android {                                                                                     │
│   defaultConfig {                                                                             │
│     minSdkVersion 23                                                                          │
│   }                                                                                           │
│ }                                                                                             │
│                                                                                               │
│ Following this change, your app will not be available to users running Android SDKs below 23. │
│ Consider searching for a version of this plugin that supports these lower versions of the     │
│ Android SDK instead.                                                                          │
│ For more information, see:                                                                    │
│ https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration          │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1

 

 

● 해결 방법


[./android/app/build.gradle] 파일을 열고 defaultConfig 를 찾아 minSdk, targetSdk 를 수정해 줍니다.

전 위 에러로그에서 23 으로 변경하라고 해서 23으로 수정 후 정상빌드 되었습니다.

LIST