콘텐츠로 건너뛰기

Google Play Services 충돌 해결

다양한 프레임워크의 여러 플러그인이 서로 다른 버전의 google-play-services 라이브러리를 사용할 수 있으며, 이로 인해 라이브러리 버전이 오래되어 프로젝트 컴파일에 실패하거나 충돌이 발생할 수 있습니다.

다음 섹션에서는 다양한 플러그인에 대한 해결 방법을 제공합니다.

라이브러리 위치

Anchor link to

Google Play Services 라이브러리는 <Android SDK>/extras/google에서 찾을 수 있습니다.

라이브러리는 두 가지 형식으로 제공됩니다:

  1. 모놀리식 jar 파일 (모든 Google Play Services 구성 요소를 단일 파일에 포함):

    sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar
  2. 모듈식 aar 파일 (Android Archive), 각 구성 요소는 별도의 파일에 있음:

    sdk/extras/google/m2repository/com/google/android/gms/…

aar 파일은 압축을 풀고(aar은 zip 아카이브임) classes.jar(라이브러리 코드)를 가져와 jar 파일로 변환할 수 있습니다(현재 모든 프레임워크가 aar을 지원하는 것은 아님).

1. Cordova

Anchor link to

Cordova에서의 모든 google play services 충돌은 gradle을 사용하여 자동으로 해결됩니다. 때때로(예: 다른 플러그인이 라이브러리의 다른 주 버전을 사용하는 경우) 해결에 실패하고 결과 빌드에 동일한 라이브러리의 두 가지 다른 버전이 나타날 수 있습니다.

2. Unity, Appcelerator Titanium

Anchor link to

플러그인(또는 샘플 프로젝트)에서 Google Play Services 라이브러리를 찾을 수 있습니다. 가능한 충돌을 해결하기 위해 쉽게 업데이트/변경/제거할 수 있습니다:

Terminal window
rm -rf Assets/Plugins/Android/google-play-services_lib/libs
rm -rf Assets/Plugins/Android/google-play-services_lib/res
cp ${ANDROID_HOME}/extras/google/m2repository/com/google/android/gms/play-services-analytics/8.4.0/play-services-analytics-8.4.0.aar Assets/Plugins/Android/
cp ${ANDROID_HOME}/extras/google/m2repository/com/google/android/gms/play-services-ads/8.4.0/play-services-ads-8.4.0.aar Assets/Plugins/Android/

3. Adobe Air

Anchor link to

ANE 확장 파일을 가져와 압축을 풀고 수정한 다음 다시 패키징합니다.

PushNotification.ane으로 다음 예제를 사용하세요:

Terminal window
unzip PushNotification.ane -d tmp

이 명령어는 .ane 파일의 내용을 tmp 디렉터리로 추출합니다.

이제 tmp/META-INF/ANE/Android-ARM/tmp/META-INF/ANE/Android-x86/에서 수정/업데이트/제거되었을 수 있는 모든 라이브러리(android-support, play-services)를 찾을 수 있습니다.

여전히 위 문서의 링크를 따르고 있다면, tmp/META-INF/ANE/Android-ARM/platform.xmltmp/META-INF/ANE/Android-x86/platform.xml을 변경한 다음, 확장 파일을 다시 압축하면 모든 것이 정상적으로 작동해야 합니다.

다음과 같은 오류가 발생하면:

PushNotification.ane은(는) 유효한 네이티브 확장 파일이 아닙니다.

다음 단계에 따라 확장 파일을 다시 패키징하세요:

  1. tmp/META-INF/ANE/Android-ARM/platform.xmltmp/META-INF/ANE/Android-x86/platform.xml을 삭제합니다.
  2. 위 링크의 가이드에 따라 tmp/META-INF/ANE/Android-ARM/android-depends.xmltmp/META-INF/ANE/Android-x86/android-depends.xml을 대신 수정합니다.
  3. 다음 bash 명령어를 실행합니다:
Terminal window
# iOS에서 platform.xml 이름 변경, 확장 파일 재패키징에 필요
mv tmp/META-INF/ANE/iPhone-ARM/platform.xml tmp/META-INF/ANE/iPhone-ARM/platform-iOS.xml
# adt로 확장 파일 다시 패키징
cd tmp/META-INF/ANE/
“${flex.sdk}/bin/adt" -package -target ane PushNotification.ane extension.xml -swc ../../../../SWC-Pushwoosh/PushNotification.swc -platform iPhone-ARM -platformoptions iPhone-ARM/platform-iOS.xml -C iPhone-ARM/ . -platform Android-ARM -platformoptions Android-ARM/android-depends.xml -C Android-ARM/ . -platform Android-x86 -C Android-x86/ . -platformoptions Android-x86/android-depends.xml -platform default -C default/ .

PushNotification.swc는 여기에서 찾을 수 있습니다: https://github.com/Pushwoosh/pushwoosh-adobe-air/blob/master/SWC-Pushwoosh/PushNotification.swc

4. Unreal Engine

Anchor link to

Unreal Engine과 Pushwoosh 플러그인은 거의 항상 서로 충돌합니다. 이는 Unreal Engine이 기본적으로 Google Play services를 포함하고 있으며, 엔진의 다른 버전이 이러한 라이브러리의 다른 버전을 사용하기 때문입니다. Pushwoosh 플러그인도 이러한 라이브러리를 사용하지만, 다른 하위 집합을 사용합니다. Unreal Engine용 Pushwoosh 플러그인을 통합할 때는 항상 주의해야 합니다. 프로젝트가 잘 컴파일되고 작동하는 것처럼 보이더라도, Pushwoosh와 Unreal Engine이 동일한 버전의 Google Play Services를 사용하는지 확인하세요. 한 프로젝트에서 다른 버전의 google-play-services를 사용하면 정의되지 않은 동작이 발생합니다.

충돌을 해결하려면 다음을 수행해야 합니다:

1. 프로젝트에서 이미 사용 중인 Google Play services 라이브러리를 확인합니다. ${UNREAL_PROJECT}/Intermediate/Android/APK/JavaLibs${UNREAL_PROJECT}/Intermediate/Android/APK/libs 디렉터리를 확인하세요. 예를 들어, Unreal Engine 4.15를 사용하여 생성된 샘플 프로젝트에는 다음과 같은 라이브러리가 있습니다:

JavaLibs:

  • downloader_library
  • play-services-ads-lite-9.2.0
  • play-services-auth-base-9.2.0
  • play-services-basement-9.2.0
  • play-services-drive-9.2.0
  • play-services-gass-9.2.0
  • play-services-plus-9.2.0
  • support-v4-23.0.0
  • play-services-ads-9.2.0
  • play-services-auth-9.2.0
  • play-services-base-9.2.0
  • play-services-clearcut-9.2.0
  • play-services-games-9.2.0
  • play-services-nearby-9.2.0
  • play-services-tasks-9.2.0
  • pushwoosh-ue-plugin // Pushwoosh 플러그인에 의해 추가됨

libs:

  • SystemUtils.jar
  • VrApi.jar
  • play-services-gcm-9.2.0.jar // Pushwoosh 플러그인에 의해 추가됨
  • play-services-iid-9.2.0.jar // Pushwoosh 플러그인에 의해 추가됨

2. Pushwoosh와 Unreal Engine에서 사용되는 play-services* 라이브러리의 버전이 일치하지 않으면, Pushwoosh 플러그인에서 이러한 라이브러리를 제거하세요.

3. Pushwoosh 플러그인에 추가해야 할 누락된 라이브러리를 확인합니다. 플러그인에는 android-support-v4, play-services-base, play-services-basement, play-services-gcm, play-services-iid 라이브러리가 필요합니다. 샘플 프로젝트의 경우 play-services-gcmplay-services-iid만 겹치지 않으므로, 이 특정 경우에는 이 두 라이브러리만 추가해야 합니다.

4. Android SDK의 .jar 파일을 https://github.com/Pushwoosh/pushwoosh-unreal-engine/tree/master/Plugins/Pushwoosh/lib/Android/libs에 배치하여 라이브러리를 추가합니다. Google Play 라이브러리의 위치는 이 문서의 시작 부분에 설명되어 있습니다.

여러분의 피드백을 공유해 주세요

Anchor link to

여러분의 피드백은 더 나은 경험을 만드는 데 도움이 됩니다. SDK 통합 과정에서 어려움을 겪으시면 이 양식을 통해 저희에게 의견을 공유해 주세요.