문의 시, 사용하시는 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으로 되어있습니다.
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 라이브러리 2.8.5 버전과 2.8.9 버전이 충돌이 발생한 것 같네요.
최신 버전(2.15.0) 기준으로 카카오SDK 내부에서 gson 2.8.9 버전을 사용하고 있기 때문에 카카오SDK 의존성을 추가할 때 아래와 같이 gson을 exclude 하면 정상동작하는지 확인해보면 좋을 것 같습니다.
알려주셔서 감사합니다 위 말씀대로 작업을 했더니 이런 오류가 발생을 했습니다.
mainTemplate.gradle 에서 implementation “com.kakao.sdk:v2-all:2.11.0” 아래에 exclude group: “com.google.code.gson:gson” 추가했고 안드로이드 스튜디오 build.gradle(module) dependencies 안에 sdk 밑에 추가했더니
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.
==============================================================================
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.
==============================================================================
카카오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이 명시되어 있지 않아 에러가 발생하는 것으로 보입니다. 이 부분도 한번 확인해보시면 좋을 것 같네요