facebook / facebook-sdk-for-unity

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

Use play service resolver instead of bundling the android libs #42

Open 00christian00 opened 7 years ago

00christian00 commented 7 years ago

Handling android libs can be quite a nightmare once you have several plugins. I noticed many have started using the play service resolver to bundle them, which just copy the libs from the sdk when needed: https://github.com/googlesamples/unity-jar-resolver This is much better and streamlined cause you don't end up with many copies of the same libs everywhere. Could you implement it for the next version? It's very easy, just need to add one class which specify which libs you need.

Allough commented 7 years ago

This is becoming an almost must have now. I'm about to drop Facebook entirely due to how much extra work it is to mess with all this crap. (Just wasted about an hour trying to get a clients game to build again, after importing Facebook).

+1!

Khaled-Almoukhtar commented 7 years ago

+1

rchallenger commented 7 years ago

For now I could find necessary libraries adding next lines to my default dependencies. It solved versions conflict, but didn't help to run app normally. It always crashes.

    //general dependency
    Google.VersionHandler.InvokeInstanceMethod (
        svcSupport, "DependOn",
        new object [] {
            "com.android.support",
            "support-v4",
            "LATEST"
        },
        namedArgs: new Dictionary<string, object> ( ) {
                {
                    "packageIds",
                    new string[] { "extra-android-m2repository" }
                }
            }
        );

    //facebook dependency
    Google.VersionHandler.InvokeInstanceMethod (
        svcSupport, "DependOn",
        new object [] {
            "com.android.support",
            "cardview-v7",
            "LATEST"
        },
        namedArgs: new Dictionary<string, object> ( ) {
                {
                    "packageIds",
                    new string[] { "extra-android-m2repository" }
                }
            }
        );
bdominguez commented 7 years ago

Recently Unity has added Gradle build system and Gradle templates:

{UNITY_PATH}\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates

Combined with this that Unity is considering it we will have a much better workflow:

https://forum.unity3d.com/threads/dealing-with-new-style-aars-that-have-applicationid-in-their-androidmanifest-xml.380596/#post-2976463

Please write on that thread to push Unity working on this faster.