universal-tools / UTNotificationsFeedback

7 stars 0 forks source link

UTNotifications is not playing well with Facebook SDK 7.10.0 on Android #57

Closed manofspirit closed 7 years ago

manofspirit commented 7 years ago

Hi there,

I'm unable to build android project with gradle when both UTNotifications and FB SDK 7.10.0 (released 2 days ago).

Can you please look.

yuriy-universal-ivanov commented 7 years ago

@manofspirit The issue is confirmed, working on a fix.

yuriy-universal-ivanov commented 7 years ago

@manofspirit ,

There are two main issues with this latest FB SDK 7.10.0.

  1. It uses an outdated and buggy Google Play Services Resolver
  2. It internally specifies a non-latest version of Android Support Library ("25.3.1"), and UTNotifications expect version "LATEST", which is currently 26.0.0-alpha1.

Fortunately, it's easy to solve.

  1. You have a Unity project before importing the latest Facebook SDK into it.
  2. In Assets/UTNotifications/Editor/Android/UTNotificationsDependencies.cs replace Google.VersionHandler.InvokeInstanceMethod(svcSupport, "DependOn", new object[] { "com.android.support", "support-v4", GetAndroidSupportPluginVersion() }, namedArgs: new Dictionary<string, object>() by Google.VersionHandler.InvokeInstanceMethod(svcSupport, "DependOn", new object[] { "com.android.support", "support-v4", "25.3.1" }, namedArgs: new Dictionary<string, object>()
  3. Delete all support-* files from your Assets/Plugins/Android folder.
  4. Restart Unity, make sure Google Play Services Resolver resolved 25.3.1 version of Android support libs.
  5. Now you can import Facebook SDK. When importing, uncheck a checkbox on PlayServicesResolver folder to not override existing version of the resolver with an outdated one.
  6. Everything should work fine now.

Please let me know if you're still facing any issues.

Best regards, Yuriy, Universal Tools team.

manofspirit commented 7 years ago

Thanks, it worked :)