본문 바로가기

IT 관련 기타/에러 모음

[Android][ERROR]The application's minSdkVersion is newer than the device API level 해결 방법.



문제


새로운 안드로이드 프로젝트를 만들어서 진행하려고 하는데 빌드 시 다음과 같은 에러가 났습니다.


Installation did not succeed. 
The application could not be installed: INSTALL_FAILED_OLDER_SDK. 
The application's minSdkVersion is newer than the device API level.


무슨 문제인가 싶어서 확인해보니 현재 저의 VM의 SDK버전이 제가 프로젝트에서 셋팅한 

최소 버전의 SDK버전 보다 낮아서 발생하는 문제였습니다.

해결하기 위해서 최소 SDK 버전을 더 낮춰야 했는데 방법은 아래와 같습니다.





해결방법


먼저 build.gradle 파일을 열어줍니다.

위치는 Project -> app -> build.gradle 로 아래 사진을 참고해 주세요.


해당 파일을 열면 저의 경우 

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.dj.dpstudy"
minSdkVersion 29
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
repositories {
mavenCentral()
}

와 같은 gradle 셋팅 파일이 존재하는데 이 중 minSdkVersion의 버전을 낮춰주시면 됩니다.

제 VM의 경우 28 버전으로 잡혀있어서 다음과 같이 변경해주었습니다.

defaultConfig {
applicationId "com.dj.dpstudy"
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}