안드로이드/안드로이드 스튜디오 에러
gradle :app:dependencies 에러
이우찬
2024. 11. 5. 16:06
반응형
라이브러리들 버전 정리좀 하려다가 어느순간 부터 :app:dependencies가 제대로 동작하지 않았다.
에러는 다음과 같았는데
* What went wrong:
An exception occurred applying plugin request [id: 'com.android.library']
> Failed to apply plugin 'com.android.internal.library'.
> The configurator service has already configured the build analyzer service. To add execution time warnings, add them directly to the BuildAnalyzerService.
* 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.
생각보다 원인을 찾기가 어려웠다. (검색해도 별 내용이 안나옴..)
그러다가 마침내 원인을 찾았는데,
gradle.properties에 다음과 같은 옵션이 문제였다.
org.gradle.configureondemand=true
이 옵션은 예전에 빌드속도를 향상시키기 위해 넣은 옵션이었다.
정리하면,
- 이 옵션은 빌드를 최적화하기 위해 필요한 프로젝트만 구성하려고 한다.
- 그러나 AGP의 내부 서비스(예: Build Analyzer Service)는 특정한 순서와 방식의 구성을 예상한다. 위 옵션이 이를 방해할 수 있습니다.
- 그 결과 AGP의 플러그인을 적용할 때 충돌이 발생해서 나타난 에러.
위 옵션을 false로 바꾸고 해결되었다
반응형