유니티 카카오톡 로그인의 대한 질문입니다

문의 시, 사용하시는 SDK 버전 정보와 디벨로퍼스 앱ID를 알려주세요.
___유니티 2021.3.1f1 버전이랑 안드로이드 스튜디오 버전 2021.2.1.16 버전을 사용중입니다 sdk 버전은 android 12.0을 사용중입니다. 디벨로퍼스 앱id는 : 940376입니다.
https://drive.google.com/file/d/1ZYCrJ1WRtq2ioTIsNnPo3M0jQJgezzSM/view 위 자료를 참고해서 키 해쉬 값을 얻기 위해서 빌드를 하려고 하는데 문제가 발생을 해서 도움을 요청합니다.

유니티 baseProjectTemplate.gradle에서는 classpath ‘com.android.tools.build:gradle:4.0.1’ 으로 설정이 되어있고
안드로이드 스튜디오에서 gradle plugin version은 7.2.2이고 gradle version 7.3.3 입니다 kotlin version 1.7.10으로 되어있습니다.

Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :launcher:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:javaPreCompileRelease UP-TO-DATE
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:generateReleaseResources UP-TO-DATE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:extractDeepLinksRelease UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
Task :unityLibrary:processReleaseManifest UP-TO-DATE
Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
Task :launcher:mergeReleaseResources UP-TO-DATE
Task :unityLibrary:generateReleaseRFile UP-TO-DATE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:processReleaseManifest UP-TO-DATE
Task :launcher:processReleaseResources UP-TO-DATE
Task :launcher:prepareLintJar UP-TO-DATE
Task :unityLibrary:compileReleaseKotlin UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
Task :unityLibrary:compileReleaseJavaWithJavac UP-TO-DATE
Task :unityLibrary:bundleLibCompileToJarRelease UP-TO-DATE
Task :launcher:checkReleaseDuplicateClasses FAILED
Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
23 actionable tasks: 1 executed, 22 up-to-date

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()
위 오류 및

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2021.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2021.3.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-6.1.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

stderr[

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:launcher:checkReleaseDuplicateClasses’.

1 exception was raised by workers:
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.gson.ExclusionStrategy found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldAttributes found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$2 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$3 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$4 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$5 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingPolicy$6 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.FieldNamingStrategy found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$2 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$3 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$4 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$5 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.Gson$FutureTypeAdapter found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.GsonBuilder found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.InstanceCreator found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonArray found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonDeserializationContext found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonDeserializer found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonElement found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonIOException found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonNull found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonObject found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonParseException found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonParser found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonPrimitive found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonSerializationContext found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonSerializer found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonStreamParser found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.JsonSyntaxException found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.LongSerializationPolicy found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.LongSerializationPolicy$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.LongSerializationPolicy$2 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.TypeAdapter found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.TypeAdapter$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.TypeAdapterFactory found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.annotations.Expose found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.annotations.JsonAdapter found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.annotations.SerializedName found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.annotations.Since found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.annotations.Until found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.$Gson$Preconditions found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.$Gson$Types found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.$Gson$Types$GenericArrayTypeImpl found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.$Gson$Types$ParameterizedTypeImpl found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.$Gson$Types$WildcardTypeImpl found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$10 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$11 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$12 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$13 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$14 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$2 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$3 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$4 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$5 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$6 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$7 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$8 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.ConstructorConstructor$9 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.Excluder found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.Excluder$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.GsonBuildConfig found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.JavaVersion found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.JsonReaderInternalAccess found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LazilyParsedNumber found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$AvlBuilder found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$AvlIterator found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$EntrySet found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$EntrySet$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$KeySet found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9.jar (com.google.code.gson:gson:2.8.9)
Duplicate class com.google.gson.internal.LinkedHashTreeMap$KeySet$1 found in modules com.google.code.gson.gson-2.8.5.jar (com.google.code.gson.gson-2.8.5.jar) and gson-2.8.9
위 오류가 나타나집니다.

안녕하세요.

해당 빌드에러는 카카오와 무관한 gson 버전 충돌 에러 같은데요?
아래내용 참고해보시겠어요?

https://forum.unity.com/threads/duplicate-class-found-in-modules-different-versions-of-same-library-imported-by-different-plugins.1268750/

2개의 좋아요

안녕하세요

첨부해주신 에러 로그를 확인했을 때는 gson 라이브러리 2.8.5 버전과 2.8.9 버전이 충돌이 발생한 것 같네요.
최신 버전(2.15.0) 기준으로 카카오SDK 내부에서 gson 2.8.9 버전을 사용하고 있기 때문에 카카오SDK 의존성을 추가할 때 아래와 같이 gson을 exclude 하면 정상동작하는지 확인해보면 좋을 것 같습니다.

implementation("com.kakao.sdk:v2-${moduleName}:${SdkVersion}") {
    exclude group: "com.google.code.gson:gson"
}
2개의 좋아요

알려주셔서 감사합니다 위 말씀대로 작업을 했더니 이런 오류가 발생을 했습니다.
mainTemplate.gradle 에서 implementation “com.kakao.sdk:v2-all:2.11.0” 아래에 exclude group: “com.google.code.gson:gson” 추가했고 안드로이드 스튜디오 build.gradle(module) dependencies 안에 sdk 밑에 추가했더니

  • Where:
    Build file ‘D:\NeoLab\200 Dev\SKIN10_App\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\build.gradle’ line: 7

  • What went wrong:
    A problem occurred evaluating project ‘:unityLibrary’.

Could not find method exclude() for arguments [{group=com.google.code.gson:gson}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • 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.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:unityLibrary’.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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

BUILD FAILED in 813ms
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

A problem occurred configuring project ‘:unityLibrary’.

compileSdkVersion is not specified. Please add it to build.gradle

  • 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

BUILD FAILED in 813ms
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at :0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <cef18509d2a64c60b8ff238a98d49698>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action1[T] progress) (at :0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at :0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at :0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at :0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput buildProgramOutput) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at :0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.Int32 subtarget, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <1135c66e5f4c41a7831fa5798849d8b6>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
gradle build 에러가 발생했습니다 위 에러가 안드로이드 스튜디오랑 유니티랑 gradle 버전이 안맞아서 나는 오류인건가요?

카카오SDK 2.11.0 버전의 의존성을 추가하신거면 SDK에서 gson 2.8.5 버전과 2.8.9 버전을 둘 다 사용하지 않기 때문에 카카오SDK의 문제라고 보긴 어려울 것 같아요. 이전에 제가 가이드드렸던 exclude 관련 내용은 제거 부탁드립니다.

유니티 환경과 개발 중이신 프로젝트 환경을 정확히 알지 못해서 정확한 원인 파악은 어렵지만, 우선 gradle 4.0.1 버전과 Android Gradle Plugin (이하 agp) 7.2.2 버전은 호환되지 않는 버전이기 때문에 gradle 버전업을 하는게 좋을 것 같습니다. agp 7.2.2 버전 호환에 대한 내용은 공식 가이드 참고하시면 좋을 것 같아요

그리고 에러 로그를 확인했을 때 unityLibrary에 compileSdkVersion이 명시되어 있지 않아 에러가 발생하는 것으로 보입니다. 이 부분도 한번 확인해보시면 좋을 것 같네요

1개의 좋아요

implementation(“com.kakao.sdk:v2-${moduleName}:${SdkVersion}”) {
exclude group: ‘com.google.code.gson’, module: ‘gson’
}
으로 수정해서 했더니 빌드 및 실행이 성공했습니다 감사합니다.

1개의 좋아요

알려주신 두분다 감사합니다 덕분에 해결했습니다.

1개의 좋아요