Gradle
gradle 에러 : Could not find method compile() for arguments
구티맨
2022. 11. 22. 21:56
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method compile() for arguments [com.amazonaws:aws-xray-recorder-sdk-core] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
at org.gradle.internal.metaobject.AbstractDynamicObject$CustomMissingMethodExecutionFailed.<init>(AbstractDynamicObject.java:190)
at org.gradle.internal.metaobject.AbstractDynamicObject.methodMissingException(AbstractDynamicObject.java:184)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:86)
Could not find method compile() for arguments 라는 에러가 발생하였습니다.
gradle에서 compile() 을 호출하는 라인에서 에러가 발생한 것인데,
compile, testCompile, runtime, testRuntime 이 Gradle 7.0에서 삭제가 되어 발생한 오류 입니다.( Gradle 4.10부터 Deprecated )
implementation, testImplementation, runtimeOnly, testRuntimeOnly 로 대체되었으니 이 4가지 메서드를 사용하도록 합니다.
버전을 확인해보면, 7.5.1을 사용하는 것을 확인할 수 있습니다.
./gradlew --version
Welcome to Gradle 7.5.1!
Here are the highlights of this release:
- Support for Java 18
- Support for building with Groovy 4
- Much more responsive continuous builds
- Improved diagnostics for dependency resolution
For more details see https://docs.gradle.org/7.5.1/release-notes.html
------------------------------------------------------------
Gradle 7.5.1
------------------------------------------------------------
Build time: 2022-08-05 21:17:56 UTC
Revision: d1daa0cbf1a0103000b71484e1dbfe096e095918
Kotlin: 1.6.21
Groovy: 3.0.10
Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM: 17.0.5 (Azul Systems, Inc. 17.0.5+8-LTS)
OS: Mac OS X 12.6.1 aarch64