OneSignal / OneSignal-Android-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal. https://onesignal.com
Other
604 stars 368 forks source link

Cannot assemble project with latest (11.4.2) Google Play Services and ProGuard enabled. #347

Closed albedinsky closed 6 years ago

albedinsky commented 6 years ago

Build configuration

Dependencies

only relevant ones are listed

  • com.google.android.gms:play-services...: 11.4.2
  • com.onesignal:OneSignal: 3.6.4

Build stacktrace

Gradle console


Optimizing...

Unexpected error while performing partial evaluation: Class = [com/google/android/gms/internal/zzbyl] Method = [zza(Lcom/google/android/gms/common/api/Api$zzb;)V] Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [com/google/android/gms/internal/zzbyw] (with 2 known super classes) and [com/google/android/gms/common/api/internal/zzcj] (with 2 known super classes))

Warning: Exception while processing task java.io.IOException: java.lang.IllegalArgumentException: Can't find common super class of [com/google/android/gms/internal/zzbyw] (with 2 known super classes) and [com/google/android/gms/common/api/internal/zzcj] (with 2 known super classes) :mobile:transformClassesAndResourcesWithProguardForDevelopmentReleaseCandidate FAILED

FAILURE: Build failed with an exception.

BUILD FAILED



## Observation ##

With _Google Play Services_ library in version **11.2.2** the build _assembles_ **successfully**.
jkasten2 commented 6 years ago

@albedinsky Thanks for the details. The issue is due a mixture of different versions of modules under the com.google.android.gms group that you may have missed

com.onesignal:OneSignal:3.6.4 defines the following com.google.android.gms dependencies.

com.google.android.gms:play-services-gcm:[10.2.1,11.3.0)
com.google.android.gms:location:[10.2.1,11.3.0)

If you're forcing an of gms to 11.4.2 make sure you do so with both modules above. However like the OneSignal library, there could be other sub-dependencies on com.google.android.gms modules from other libraries in your project. You can check this by running the following to get a dependency tree.

./gradlew app:dependencies --configuration compile

Manually resolving this now and in the future when updating can be a pain however. That's why we have created a Gradle plugin which will automatically "group align" com.google.android.gms and a few other libraries. You can follow the setup instructions below. OneSignal/OneSignal-Gradle-Plugin Let me know if the Gradle plugin resolves your issue.

albedinsky commented 6 years ago

Hi @jkasten2, thank you for the reply.

I successfully integrated the plugin into my project and now the project may be successfully assembled with Google Play Services dependency in version 11.4.2 so I guess that the plugin is auto-resolving the dependencies just fine.

Thank you very much for your help.