본문 바로가기
안드로이드

[Android] Lint found fatal errors while assembling a release target. 에러 해결

by 코딩히어로 2023. 2. 13.
728x90

1


안드로이드 프로젝트에서 APK파일을 생성할 때 다음과 같은 에러가 발생했습니다

Lint found fatal errors while assembling a release target.

해당 에러 문구는 Android Studio TargetSDK를 30 버전에서 31로 올리면서 발생했는데

Android Manifests 파일에 프로그램 소스코드를 추가해주기만 하면 해결이 가능합니다.

android {
    compileSdkVersion 31

    defaultConfig {
        applicationId "com.ftdi.heungnong"
        minSdkVersion 16
        targetSdkVersion 31
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
    namespace 'com.ftdi.heungnong'
}

기본적으로 에러가 발생했을때 위와 같이 Manifests에 android 항목을 보면

compileSdkVersion과 defaultConfig 그리고 BuildTypes이 구성되어 있는데

여기에 lint라는 항목을 추가해 주어야 합니다

 

Lint found fatal errors while assembling a release target.

Fix the issues identified by lint, or create a baseline to see only new errors:
```
android {
    lint {
        baseline = file("lint-baseline.xml")
    }
}
```

For more details, see https://developer.android.com/studio/write/lint#snapshot

에러내용을 상세하게 보면  android 항목에 lint 요소를 추가하라고 잘 설명이 되어 있네요

 

수정한 Manifests

android {
    compileSdkVersion 31

    defaultConfig {
        applicationId "com.ftdi.heungnong"
        minSdkVersion 16
        targetSdkVersion 31
    }

    lint{
        baseline = file("lint-baseline.xml")
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles 'proguard.cfg'
        }
    }
    namespace 'com.ftdi.heungnong'
}

이렇게 lint 항목을 추가한 뒤에 다시 build 하여 apk추출을 하면 해당 에러내용이 사라지게 됩니다

728x90
반응형

댓글