0
votes

I'm cannot make a build after installing both the Google Play Services plugin and the Firebase Messaging plugin. I'm using the latest versions of both. I get the "Unable to convert classes into dex format" error. The two libraries that conflict are play-services-auth-10.2.6 and play-services-base-11.2.0. Google Play Services resolver grabs these two libraries for me. Anyone have a solution?

2
I suggest using one version only like 10.2.6 version or 11.2.0 and not mixed. With regard to your error, some forums say this might be related to duplicate jars and you should delete them so only one copy will be used. Check this SO post.noogui
Post your error and build.gradleGabriele Mariotti
the error ends up being something like this: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;Tony Ho

2 Answers

0
votes

I've been messing around with the GPGSDependencies.xml and the PluginVersion.cs file from the google play services plugin. I was attempting to make the library versions identical.

I did manage to get identical library versions, this did solve the DEX format issue, but when I made a call for authenticating a google account my app crashed.

This is what I did: In GPGSDependencies.xml I changed the 10+ in these lines to 11.1+

<androidPackage spec="com.google.android.gms:play-services-games:10+">
...
<androidPackage spec="com.google.android.gms:play-services-nearby:10+">
...
<androidPackage spec="com.google.android.gms:play-services-auth:10+">

And I also changed the lines in PluginVersion.cs to

// used to check for the correct min version or play services: 11.2
public const int MinGmsCoreVersionCode = 11200000;

// used to get the right version of dependencies.
public const string PlayServicesVersionConstraint = "11.1+";

from

// used to check for the correct min version or play services: 10.2
public const int MinGmsCoreVersionCode = 10200000;

// used to get the right version of dependencies.
public const string PlayServicesVersionConstraint = "10+";

The PluginVersion.cs alteration was mentioned here: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1892#issuecomment-325555313.

This didn't solve all my problems but maybe it will help you.

Let me know if you managed to solve it, I am still working on a solution.

0
votes

I got it to work with the latest google play services resolver.

https://github.com/googlesamples/unity-jar-resolver