facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
489 stars 256 forks source link

Play Services Resolver / Unity Jar Resolver's VersionHandler not being applied correctly. #98

Open stewartmiles opened 7 years ago

stewartmiles commented 7 years ago

Hi, I'm one of the maintainers of the ball of code that is the https://github.com/googlesamples/unity-jar-resolver . One of the components in the project is the VersionHandler which allows the play-services-resolver package to be transitively included by other plugins at arbitrary versions. When VersionHandler runs in the Unity editor it enables the most recent version of the plugin imported into package and performs any clean up of stale assets.

However, this requires a couple of things:

While looking into an issue with Firebase + Facebook (see https://groups.google.com/forum/#!topic/firebase-talk/SLL2I50bDPI) I discovered that the Facebook plugin doesn't seem to be transitively including the play-services-resolver package as we expect - which isn't surprising since our docs on this are limited.

In particular, -gvh_disable needs to be specified as a command line argument for Unity when importing the play-services-resolver package so that the VersionHandler doesn't activate during your packaging steps.

See https://github.com/googlesamples/unity-jar-resolver/blob/master/build.gradle#L377 for an example and https://github.com/googlesamples/unity-jar-resolver/blob/master/source/VersionHandler/src/VersionHandler.cs#L107 for where this is used.

So what would be great would be to change the following invocations in your build scripts (as far as I can tell this is where you do the export) to also specify the -gvh_disable flag: https://github.com/facebook/facebook-sdk-for-unity/blob/48e139fdd59fbb6ce414ad269e1592a2e40425af/scripts/package_sdk.sh#L26 https://github.com/facebook/facebook-sdk-for-unity/blob/6de35292f9b592f90971a70515ee6256874f6a5f/scripts/common.sh#L115

Cheers, Stewart

czater commented 7 years ago

It would be superb if someone fix this...

stewartmiles commented 7 years ago

The workaround is to:

marauderkr commented 6 years ago

Greetings, could anyone please fix this? the latest Facebook SDK in combination with the Firebase SDK still causes a dex build error in Unity. even the workaround @stewartmiles mentioned does not work at the moment and the issue is almost one year old now.