반응형
Android Studio 프로젝트의 명령 줄에서 Gradle을 사용한 빌드 실패 : Xlint 오류
이 명령을 사용하여 gradle로 Android 프로젝트를 빌드하려고 할 때 :
> gradlew clean build assembleRelease
이 오류가 발생합니다.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
이 프로젝트를 빌드하고 Studio에서 APK를 만들 수 있습니다.
Xlint 알림을 무시하고 컴파일을 수행하도록 Gradle을 구성하는 방법이 있습니까?
또는 다른 매개 변수를 사용하여 gradle / gradlew를 사용하여 명령 줄에서 릴리스 할 수 있습니까?
오류가 아니라 좋은 경고입니다. 전체 Lint 보고서를 보려면 다음 행을 build.gradle에 추가 할 수 있습니다.
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
이러한 경고를 정말로 제거하려면 :
- 더 이상 사용되지 않는 API를 사용하지 마십시오.
- @SuppressWarnings ( "deprecation") 사용
이 @의 shakalaca의 대답에서 매우 분명하다,하지만 당신은 중단 경고를 얻을 코드 오래된만큼이있는 경우, 당신은 또한 예를 들면되지 않은 작업을 사용하는 코드 옛 충분히있을 수 List
와 같이 파라미터 화 된 형태 않고를 List<String>
. 그러면 추가 경고가 표시됩니다.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
컴파일러 args 블록을 확장하여이를 포함 할 수 있습니다.
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
}
}
반응형
'UFO ET IT' 카테고리의 다른 글
HttpURLConnection 객체에서 JSON 구문 분석 (0) | 2021.01.06 |
---|---|
쉘 스크립트의 내용으로 파일 만들기 (0) | 2021.01.06 |
명령 출력을 변수에 할당 (0) | 2021.01.06 |
std :: lower_bound 및 std :: upper_bound의 이론적 근거? (0) | 2021.01.06 |
설정 방법 (0) | 2021.01.05 |